I can generate files which appear to be the correct size using this with PHP:
`exiftool -b ThumbnailImage $image>$thumb`
but I'm unable to view them. I read here (https://exiftool.org/forum/index.php/topic,2161.msg9515.html#msg9515) about the age-old newline problem. This code was included in the post:
open (OUT, '>perl.jpg') or die "cannot open perl.jpg";
binmode OUT;
print OUT $$val;
Am I looking in the right direction? If so, how would I go about fixing this in a PHP environment?
Thanks,
Mark
You don't need to worry about the binmode. ExifTool sets that automatically when you use the -b option. There must be something else going on here, but I don't know what. (Other than the missing "-" in the "-thumbnailimage" argument.)
Did you check the messages that exiftool returns?
- Phil
Tried -thumbnailimage -b
but all I got were 0 byte files. Switched to -thumbnailimage -b
and it worked a charm.
Thanks, Phil!
Quote from: machouinard on March 03, 2012, 08:09:11 PM
Tried -thumbnailimage -b
but all I got were 0 byte files. Switched to -thumbnailimage -b
and it worked a charm.
? That's the same thing.
- Phil
My mistake. When I added the missing - to the code in my first post:
`exiftool -b ThumbnailImage $image>$thumb`
I was getting files with 0 bytes. Just had to place the -b after -thumbnailimage.
Mark
Hi Mark,
The order doesn't matter. -thumbnailimage -b is the same as -b -thumbnailimage.
So something else must have been going on. I suspect that you accidently misspelled thumbnailimage in one command.
- Phil