03-25-2021, 04:53 PM
(This post was last modified: 03-25-2021, 05:00 PM by calinb.)
(03-25-2021, 02:56 PM)Maus Wrote: I'm sorry to read you lost your images, but you are absolutely right, reading only the introductory comment lines, especially the last two of them, would have helped:
# The post-processing script is responsible for cleaning up
# temporary directory for the burst.
<snip>
Thanks, Maus! Yeah, I'm not much of a script meister so sometimes I take heuristic shortcuts to study behavior rather than studying the code. I've been in computing since before "microcomputers" even existed. FORTRAN, K&R C, and assembler is mostly how I learned a living many years ago.
But at least I finally settled into reviewing the code and I found the bug. I guess it's best to stick to POSIX syntax when using sh and perhaps a new intolerance to legacy code just bit postprocess.sh!
I changed line 69 in postprocess.sh from
Code: if [ "$CONVERT" == "convert" ]; then
to
Code: if [ "$CONVERT" = "convert" ]; then
I setup test subdirectories and ran the script from the terminal and it worked only with the change in operator syntax. I have .jpg files now!
From https://stackoverflow.com/questions/2044...erators-eq
== is a bash-ism, by the way. It's better to use the POSIX =. In bash the two are equivalent, and in plain sh = is the only one guaranteed to work.
Now I need to discover where to file a bug report.
03-26-2021, 01:38 AM
(This post was last modified: 03-26-2021, 01:53 AM by Maus.)
(03-25-2021, 04:53 PM)calinb Wrote: But at least I finally settled into reviewing the code and I found the bug. I guess it's best to stick to POSIX syntax when using sh and perhaps a new intolerance to legacy code just bit postprocess.sh!
Great find! The funny thing is, just a week ago I sort of lectured interpreter agnostic shell scripting to my apprentice, with exactly this as a common example, but I didn't spot the problem here ... I'm also getting older every day.
This has already been fixed by Martijn, and will probably land in Mobian soon.
03-26-2021, 04:13 AM
(This post was last modified: 03-26-2021, 04:16 AM by calinb.)
(03-26-2021, 01:38 AM)Maus Wrote: Great find! The funny thing is, just a week ago I sort of lectured interpreter agnostic shell scripting to my apprentice, with exactly this as a common example, but I didn't spot the problem here ... I'm also getting older every day.
This has already been fixed by Martijn, and will probably land in Mobian soon.
Thanks for the comment and link to Martijn's latest code. Lacking a way to file a bug report, I sent Martijn an email and apparently he fixed the script very promptly (9 hours ago)!
As graphicsmagick compatibility has been added I tried swapping imagemagick for graphicsmagick and this also works as a quick fix, just in case..
(03-26-2021, 04:18 AM)battlegarden Wrote: As graphicsmagick compatibility has been added I tried swapping imagemagick for graphicsmagick and this also works as a quick fix, just in case..
Yes. Good point. After the script's existence test for imagemagick errors, due to the bash-ism, it will use gm, if installed. I've not looked into gm but maybe it's a better choice than im for this usage anyway, because I suspect gm may be a lighter weight program and the im GUI doesn't seem terribly usable on PinePhone Mobian to me.
But, for the first time, I'm now getting .jpg files in my Pictures folder using Megapixels so "if it works, don't fix it" is the approach I'm sticking-with!
Hello there,
has anyone found out how to tell megapixels where to store the jpegs? In my case, it's plain $HOME and I want to change it (back) to $HOME/Pictures.
Thanks in advance!
Cheers!
(03-26-2021, 05:20 AM)arno_nuehm Wrote: has anyone found out how to tell megapixels where to store the jpegs? In my case, it's plain $HOME and I want to change it (back) to $HOME/Pictures.
This is determined programmatically here. I' not sure how files could end up directly in $HOME, though. If the environment is sane, files should show up in (a localised version of) $HOME/Pictures. Perhaps you changed your locale to something non-English and it would have saved to $HOME/Eikones (for example) if only the folder would have existed ... but the last else would have catched that!
(03-26-2021, 05:20 AM)arno_nuehm Wrote: Hello there,
has anyone found out how to tell megapixels where to store the jpegs? In my case, it's plain $HOME and I want to change it (back) to $HOME/Pictures.
Thanks in advance!
Cheers!
Megapixels passes the folder and filename (without extension) as arguments to postprocess.sh and I don't know how to configure this megapixels behavior but there's probably a configuration file that will do it. Maybe have a look at the source code at the link posted by Maus above or maybe someone here knows how to do it.
I see no files in /home/mobian/.config/megapixels but it might be the location where such a configuration file would go and you just need to create a valid configuration file.
If you can't find a megapixels configuration solution, you could modify the postprocess.sh script to move the files (*.jpg or whatever) from $HOME to $HOME/Pictures after they are written.
04-28-2021, 02:39 PM
(This post was last modified: 04-28-2021, 02:47 PM by Zebulon Walton.)
I just used Megapixels for the first time months while and I'm finding it's producing dng files instead of the jpg format it was previously saving. (A couple of pictures I took and saved back in January with Megapixels are in jpg format.) Both dcdraw and imgmagick are installed. Also, what exactly does Megapixels do with the QR code? I can see it zeroing in on the code and there's some tiny text which I assume is the decoded content, but all it seems to actually do is save the QR as a dng image. What does it do with the QR code data?
EDIT: In another thread I was informed that tapping the screen copies the QR code data - puts it into the paste buffer? How to retrieve it or use it?
04-28-2021, 04:16 PM
(This post was last modified: 04-28-2021, 04:18 PM by calinb.)
(04-28-2021, 02:39 PM)Zebulon Walton Wrote: I just used Megapixels for the first time months while and I'm finding it's producing dng files instead of the jpg format it was previously saving. (A couple of pictures I took and saved back in January with Megapixels are in jpg format.)
<snip>
Zebulon,
I found this bug (non-POSIX syntax in the /usr/share/megapixels/postprocess.sh). Then I patched my script and reported it to Martijnj. He promptly squashed the tiny (but deadly bug) in his source. I guess it still hasn't rolled out in a Mobian update / upgrade yet?
All you need to do is change == to = to make postprocess.sh work, like this:
Code: - if [ "$CONVERT" == "convert" ]; then
+ if [ "$CONVERT" = "convert" ]; then
As documented here:
https://git.sr.ht/~martijnbraam/megapixe...process.sh
I thought I described my fix in my last posts in this thread (after mucking my way through the debug effort).
I get .dng and .jpg now so I need to double check that you have the same helper aps that I'm using, which I'll do later today.
-Cal
|