Problem creating a thumbnail

Started by Mauricio Villablanca, November 02, 2013, 02:53:44 PM

Previous topic - Next topic

Mauricio Villablanca

Hi Phil,

I'm using your valuable tool in an Android app that will allows users to upload screenshots from their mobile device.

I'm having problems creating thumbnails for PNG screenshots generated by Android devices. When I view the file in Windows Explorer, it clearly shows a thumbnail. I tried two commands and they both generate a 0-byte image:

exiftool.exe -if $ThumbnailImage -b -ThumbnailImage "Screenshot_2013-10-31-14-40-59.png" > "tn_Screenshot_2013-10-31-14-40-59.jpg" -ext PNG

exiftool.exe -if $previewimage -b -previewimage "Screenshot_2013-10-31-14-40-59.png" > "tn_Screenshot_2013-10-31-14-40-59.jpg" -ext PNG

I'm using the latest version of ExifTool (9.3.9). Are these type of images supported? If so, am I missing something?

Please see attached Android-generated screenshot.


Thank you for your support.

For anyone interested, the app is Pocket Zoo:
https://play.google.com/store/apps/details?id=air.com.mauriciovillablanca.pocketZoo





Phil Harvey

ExifTool only extracts embedded JPEG images, it doesn't generate them like Windows Explorer probably does.  Do you see any images when you run exiftool without any arguments on the file?  The will look like this in the output:

Preview Image                   : (Binary data 174872 bytes, use -b option to extract)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Mauricio Villablanca

No there's no embedded content. The output is:

ExifTool Version Number         : 9.39
File Name                       : Screenshot_2013-10-31-14-40-59.png
Directory                       : .
File Size                       : 842 kB
File Modification Date/Time     : 2013:11:02 11:35:50-07:00
File Access Date/Time           : 2013:11:02 11:46:06-07:00
File Creation Date/Time         : 2013:11:02 11:46:06-07:00
File Permissions                : rw-rw-rw-
File Type                       : PNG
MIME Type                       : image/png
Image Width                     : 1280
Image Height                    : 720
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 8 8 8
Image Size                      : 1280x720

I guess I'll need to use PHP built-in functions to generate a thumbnail.

Thank you for your prompt response.