Metadata or JPEG fileformat problem ? Resave, reupload, no playback...

Started by Adrian, April 22, 2010, 04:15:42 PM

Previous topic - Next topic

Adrian

Hi !
I scanned the forum and no solution found for my problem.
I took a photo with my Samsung i85 camera.
I Downloaded it to a PC for editing (put some arrows, labels, etc.).
I Saved with the same name, with exif conservation option.
I Reuploaded to the same camera in order to make a presentation (slideshow playback) on a TV.
The camera LCD message is "file error".

I tried a lot of metadata handling software, I saved initially all the exif data in a file then (after edit) I loaded all the metadata from that file. Always is the same result, "file error".
With "exiftool" I used only the GUI version.

Naturally, I tried also with "samsung master" image processing sw what came with the camera. No way !  Grrr...
What can be the problem ?
With my old Fuji I never had so a problem. I did not know what exif is !!! Worked with any jpeg file, any name...
Thanks !


Phil Harvey

I have taken a look at an i85 sample image I have handy.  The maker notes for this camera are currently not being decoded by ExifTool.  Also I see there is a PreviewImage trailer that ExifTool is not handling.  I will see what I can do about adding support for the PreviewImage trailer.

It is likely that the camera uses the PreviewImage for the LCD display, and I'm guessing that your editing software removes the trailer so this image is lost.  If so, this could be the source of the problem.  Adding the PreviewImage back again would be a bit tricky, but easier if you could use exiftool to save the preview before editing (again, I'll see what I can do here).  But a complication is that if there is a pointer to the preview from the maker notes then the camera still won't be able to load the preview because this pointer would need updating if the main image changed length.  Some testing would be needed to determine if this is the case.

- 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 ($).

Adrian

Thanks for the answer Phil !
Exiftool is a great work ! I read so much good thinks about. Is not a problem for me to use it, but first I chose other simpler programs. I did not suppose this problem is so big... Do You know if this problem appears at all samsung cameras ?

In order to be more specific I have a partially solution. With "Exifer" from Friedmann Schmidt I can import the exif data (and is coming also the thumbnail) from an unaltered file to my presentation photo. Then I can rebuild the thumbnail from the photo itself. And the photo is almost OK for the camera. Does not give me the file error, but the thumbnail quality is lower (64KB). This is not a problem if I paginate manually between the photos. First appears the low quality thumbnail on the camera LCD and TV, and after a second changes to the good quality picture. But if I start the slideshow on the camera, shows me only the low quality thumbnails !!!   Grrr...
All this above are working only with the photos taken with my camera. But I have photos also from others...

I would be pleased to solve the problem for only one certain resolution (by ex 3Mpix). Would be enough for me
BR. Adrian

Phil Harvey

Hi Adrian,

You can also use exiftool to copy the EXIF data from the original image:

exiftool -tagsfromfile original.jpg -exif target.jpg

There are 2 images embedded in the i85 JPEG's:  A 160x120 ThumbnailImage and a 640x480 PreviewImage (which ExifTool does not currently extract).  The PreviewImage is used by the camera for higher resolution display.  The ThumbnailImage is inside the EXIF, but the PreviewImage is stored as a trailer after the JPEG EOI.  You could try resizing the image to 640x480 and concatenating it to the end of the JPEG.  On Mac/Linux this is as simple as "cat preview.jpg >> image.jpg", but I'm not sure how to do this if you are in Windows.

- 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 ($).

Adrian

Hi Phil !
It is simply to concatenate two files in a DOS window: "copy /b file1 + file2 file3". The result is in file3.
But even I concatenate the main jpeg with another 640x480, is no difference...
I saw a lot of "FF D8.......FF D9" inside my picture.
This should be a simply concatenate or an insertion to a specific point in the file ?
Other.
If I apply "exiftool -tagsfromfile original.jpg -exif target.jpg" I obtain the file si854001_exiftool.jpg, but appears "file error" on lcd/tv.
If I do the same thing with exifer, si854002_exifer.jpg, the picture appears on lcd/tv (with low resolution preview in the first second, after is OK).

The two files are the exactly the same size !
Do You have any idea why the two exif handling produce different results ?
Thanks !

Phil Harvey

The PreviewImage in the i85 JPEG is a simple concatenation on the end of the main image.  However, it is possible that a pointer within the makernotes must be adjusted to the offset where the PreviewImage begins.  This could be why just the concatenation didn't work.

I'm not sure what exifer is doing, but I'll take a look at your samples tomorrow when I can download them and see if I can figure it out.

- 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 ($).

Phil Harvey

The only difference between these two images is that the JFIF segment comes first in the version written by exiftool.  This is the usual order when both EXIF and JFIF segments exist, although I suspect that the camera doesn't like the JFIF segment.  So I suggest deleting the JFIF when you copy over the EXIF:

exiftool -jfif:all= -tagsfromfile original.jpg -exif target.jpg

- 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 ($).

Adrian

Quote from: Phil Harvey on April 27, 2010, 07:25:54 AM
exiftool -jfif:all= -tagsfromfile original.jpg -exif target.jpg

Bingo !
You`re right ! It did not like the JFIF segment...
Now I am happy !  I can do batch operations in my photos ! Yepp !
Many Thanks Phil !
Great work this exiftool !

PS Later, if You have time, could You please give me some information about the pointer what indicates the bigger preview inside this samsung JPEG ? How can I recognize it inside the file ? And how can I calculate the new pointer in order to replace the old one ? I am greenhorn in jpeg fileformat, but I am able to manipulate blocks or strings inside the files. I should to know what bytes or bits must modify. Would be very nice to create slideshows with soundtrack. There is the possibility with i85. The restoration of the original fileformat is the big problem. Ahh, this Samsung ! Always different !
Thanks again !

Phil Harvey

Hi Adrian,

Samsung is really annoying because their makernote format is not EXIF based and not very consistent from model to model.

I took a look at the makernotes from the i85, and the PreviewImage offset and size are stored in the makernotes immediately after the 8-byte header.  They are each stored as 4-byte little-endian integers.  I will see about adding support for the i85 PreviewImage to the next version of exiftool which would allow these values to be updated automatically when writing.
...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 ($).

Adrian

Many thanks for the info and for help Phil !
I will study that format also, based on Your info.
BR
Adrian