Again: Samsung Gallery edits and the "OtherImageStart"

Started by sx8999, October 21, 2024, 04:47:49 AM

Previous topic - Next topic

sx8999

Hi all,

I just played around a bit again with a few of my Samsung S23 shots to see which EXIF data and/or Binary BLOBs are embedded within the files.

As I wanted to make some edits, I got the error 'Error reading OtherImageStart' - I came across a few threads, the newest being https://exiftool.org/forum/index.php?topic=15823.0

So first of all, the in some older thread suggested workaround:

exiftool -overwrite_original -all= -tagsfromfile @ -all:all -unsafe -icc_profile DIR

solves the problem, but it also removes other Blobs like "DepthMapTiff", "DepthMapData" - which sounds pretty useful for image editing. Not sure which SW uses this, but when extracting, it shows the Depths of objects within the image.

Question 1: Does anyone know if this is used e.g. by Photoshop or Google Photos to make better edits / bokehs etc?

Question 2: Any way to make a "generic" command into EXIFTool which handles all "problematic" fields (i.e. remove them), but keeps all other data? As we see above, the "copying" via "-all= -tagsfromfile" does not seem to work...


Now... I also played around with XnView MP&Convert which is goto Image Viewing program.
Very interestingly, this Tool does remove ALL BLOBs when compressing/saving updates to an JPG, BUT (!!) keeps specifically the OtherImageStart Tag. But XnViewMP is still able to make changes to EXIF like EXIF comments etc... So there it seems to be supported (or "ignored") instead of raising an fatal error.

Question 3: So it seems this tag does not necessarily cause a problem and CAN be ignored (by XnView at least) - could something like this also be implemented in EXIFTool? It's very tricky and annoying if we need custom statatements for handling all sorts of different files; I mean every vendor could potentially do their own special stuff which always would require specific EXIFTool commands... By the average user (even with programming experience) this leads to excessive scripting requirements IMHO

Thank you so much!
Bjoern

Phil Harvey

Hi Bjoern,

It is hard to answer some of these questions without seeing a sample image.  Could you upload a sample somewhere so we can take a look?

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

sx8999

Hi Phil,
yes sure, here you are:
https://www.dropbox.com/scl/fo/jkvhee51il8ovtuyvomct/APGUTXrmujNuDHrPZI7I_44?rlkey=ncop5yyp8219efmuq4mdyt0h1&dl=0

I uploaded 4 pictures:

1) Captured in portrait mode (-> includes BLOB DepthMap). I uploaded this one to Dropbox before actually editing it in the Gallery App, and yet it already contains the original image as full copy inside the metadata (EXIF "Embedded Image").

2) Than I edited that potrait shot -> Keeps everything, the original image can be extracted from the EXIF "Embedded Image", and funnily, changes the Byte Order from Little-Endian to Big-endian Motorola!?

3) And one "regular / normal" snapshot without portrait - Does not contain neither DepthMap nor the original Image.

4) I edited the regular one from 3) but still, the "Original Image" is not embedded. BUT: funnily I can still "Reset to original" within the Samsung Gallery App. I don't get this at all.

So my key takeaways:
* DepthMap is only embedded in case of Portrait mode.
* The original Image as Copy in EXIF "Embedded Image" is embedded in portrait mode, irrespectively if you edit the image or not.
* Strangely I can edit a picture in the Gallery App and RESET to its original look on my Samsung, even for the "regular" photo which does not have an "Embedded Image"

I used this command to extract the embedded binary Previews to a subfolder:
exiftool -preview:all -a -b -W OUTDIR/%f_%t%c.%s
I hope this helps clarifying the questions and maybe also enhancing ExifTool even further :)



Phil Harvey

That edited image is a real mess:

> exiftool 20241021_134816_portraitmode_edited.jpg -validate -warning
Validate                        : 36 Warnings (10 minor)
Warning                         : Entries in IFD0 are out of order
Warning                         : Tag ID 0x0101 ImageHeight out of sequence in IFD0
Warning                         : Tag ID 0x011b YResolution out of sequence in IFD0
Warning                         : Tag ID 0x011a XResolution out of sequence in IFD0
Warning                         : Tag ID 0x0100 ImageWidth out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x0131 Software
Warning                         : [minor] Odd offset for ExifIFD tag 0x9202 ApertureValue
Warning                         : Entries in ExifIFD are out of order
Warning                         : Non-standard format (string) for ExifIFD 0x9000 ExifVersion
Warning                         : [minor] Odd offset for ExifIFD tag 0x9000 ExifVersion
Warning                         : Tag ID 0x9000 ExifVersion out of sequence in ExifIFD
Warning                         : Tag ID 0x8822 ExposureProgram out of sequence in ExifIFD
Warning                         : Tag ID 0x9205 MaxApertureValue out of sequence in ExifIFD
Warning                         : Tag ID 0x9203 BrightnessValue out of sequence in ExifIFD
Warning                         : Tag ID 0x9003 DateTimeOriginal out of sequence in ExifIFD
Warning                         : Non-standard format (string) for ExifIFD 0xa000 FlashpixVersion
Warning                         : Tag ID 0x9291 SubSecTimeOriginal out of sequence in ExifIFD
Warning                         : Tag ID 0xa402 ExposureMode out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x829a ExposureTime
Warning                         : Tag ID 0x829a ExposureTime out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x9010 OffsetTime
Warning                         : Tag ID 0x829d FNumber out of sequence in ExifIFD
Warning                         : Tag ID 0x9292 SubSecTimeDigitized out of sequence in ExifIFD
Warning                         : Tag ID 0x9004 CreateDate out of sequence in ExifIFD
Warning                         : Tag ID 0x9207 MeteringMode out of sequence in ExifIFD
Warning                         : Tag ID 0x9011 OffsetTimeOriginal out of sequence in ExifIFD
Warning                         : Tag ID 0x9208 LightSource out of sequence in ExifIFD
Warning                         : Tag ID 0x0128 ResolutionUnit out of sequence in IFD0
Warning                         : ExifIFD tag 0x9010 OffsetTime requires ExifVersion 0231 or higher
Warning                         : ExifIFD tag 0x9011 OffsetTimeOriginal requires ExifVersion 0231 or higher
Warning                         : Missing required JPEG ExifIFD tag 0x9101 ComponentsConfiguration
Warning                         : [minor] IFD0 tag 0x0100 ImageWidth is not allowed in JPEG
Warning                         : [minor] IFD0 tag 0x0101 ImageHeight is not allowed in JPEG
Warning                         : [minor] IFD0 tag 0x0103 Compression is not allowed in JPEG
Warning                         : [minor] IFD0 tag 0x0201 OtherImageStart is not allowed in JPEG
Warning                         : [minor] IFD0 tag 0x0202 OtherImageLength is not allowed in JPEG

ExifTool won't write a file with this problem because of the possibility of losing data, however it may be used to rebuild the EXIF to fix this problem.

Here is a command to clean up this mess and preserve most of the metadata:

exiftool -exif:all= "-all:all<exif:all" FILE

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