odrevet / Multi-Picture-Object

Generate a 3D picture (Multi Picture Object) from two jpeg
8 stars 2 forks source link

Create MPO from photo and thumbnail? (not 3D image) #1

Closed feklee closed 4 years ago

feklee commented 4 years ago

I am trying to make a JPEG image viewable in a digicam, and apparently these images need to be of MPF/MPO format with the main image first and then a thumbnail. The only command line tool that I found for creating MPO images is this project. Unfortunately, it fails with two error messages when I try to create the MPO:

$ identify photo.jpg
photo.jpg JPEG 6000x4000 6000x4000+0+0 8-bit sRGB 613948B 0.010u 0:00.006
$ identify thumbnail.jpg
thumbnail.jpg JPEG 160x120 160x120+0+0 8-bit sRGB 5311B 0.000u 0:00.000
$ php cli.php -l photo.jpg -r thumbnail.jpg -o M0000011.JPG
PHP Notice:  Undefined variable: pos in /tmp/mpo.php on line 28
PHP Notice:  Undefined variable: pos in /tmp/mpo.php on line 37

Is there any support for these types of MPO images planned? Would it be hard to add?

Also, I am grateful for suggestions for alternative tools. So far I rely on Sony's Imaging Edge Desktop to convert JPEGs for viewing them in a digicam. However, that tool doesn't run on Linux, and I don't think it has batch processing support. I want to convert more than a hundred images.

odrevet commented 4 years ago

The error occurs when trying to read the image metadata

$pos if not defined when trying to get APP1 and APP2 from APP0 position. This most likely means that the mandatory APP0 is not present in the picture

I updated the read_meta function so $pos is initialized

The APP0 is also where thumbnails are found, so this may be why your digicam cannot process your pictures. You may use jhead to modify jpeg metadata

feklee commented 4 years ago

I updated the read_meta function so $pos is initialized

Thanks! Also for the details!

In the end, I managed to set the thumbnail with ExifTool as explained in my forum post Re: Make JPEG viewable in camera. Interestingly, the images that the camera takes itself are not in MPO format, if I interpret the Exif data correctly (no MPF tags). However, images saved with Sony's Imaging Edge Desktop are in MPO format, and they're accepted by the camera. When I wrote my question I was only looking at the latter images for comparison.

odrevet commented 4 years ago

Ok glad that you solved your problem. I am closing this issu