Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error opening tif file created by GIMP
#1
When using GIMP 2.10 and trying to open an image in the form of a tif file that was created by GIMP 2.8 the error shown in the attached file occurred.  Result is that that GIMP 2.10 cannot be used to process this file.  It might also be worth noting that some other programs are able to open the subject file.  This includes Picasa, XnViewMP, Paint, Canon DPP4, and Rawtherapee.  Notably Windows Photo Viewer is unable to open the subject file.

   
Reply
#2
Upon further analysis I now realize I was mistaken when writing the original post.  I've now gone back and reproduced the problem.  The mistake in my original description is that the problem tif file was NOT created by GIMP 2.8 as stated but rather by GIMP 2.10.  This is a case where GIMP 2.10 was used to open an xcf file that was created by GIMP 2.8 and then GIMP 2.10 was used to export that image to create the problem tif file.  As previously mentioned most tif compliant programs see nothing wrong with the problem file.  I've now determined that this includes GIMP 2.8.

The error messages from GIMP 2.10 says 'TIFF directory is missing required "ImageLength" field'.  Since most other programs have no problem opening the file, this implies to me that there is something about the file open logic in GIMP 2.10 (i.e., possibly associated with processing of ImageLength) that is affected by some possibly valid difference in the result produced by  GIMP 2.10 when exporting to a tif format file.
Reply
#3
You need to give more information.
There are several compression formats for exporting to a tiff file. Which one are you using? For Gimp 2.10 - what parameters there? bit depth / colour profile.

Could not reproduce the problem from the original post Gimp 2.8 tiff does not fail in Gimp 2.10 using any of the compression modes.

Still can not reproduce the problem. Gimp 2.8 xcf -> Gimp 2.10 tiff (all compression options) which open without error.

Using linux Gimp 2.10 flatpak
I do get pairs of files of the form filename.tiff / filename.tiff40 (various numbers depending on compression). One big file / one small file. Anyone any idea why? Something to do with metadata? The big tiff files open ok.
Reply
#4
(05-03-2018, 04:34 PM)rich2005 Wrote: You need to give more information.
There are several compression formats for exporting to a tiff file. Which one are you using? For Gimp 2.10 - what parameters there? bit depth / colour profile.

Could not reproduce the problem from the original post Gimp 2.8 tiff does not fail in Gimp 2.10 using any of the compression modes.

Still can not reproduce the problem. Gimp 2.8 xcf -> Gimp 2.10 tiff (all compression options) which open without error.

Using linux Gimp 2.10 flatpak
I do get pairs of files of the form filename.tiff / filename.tiff40 (various numbers depending on compression). One big file / one small file. Anyone any idea why? Something to do with metadata? The big tiff files open ok.

My problem file was exported using compression "None".  I'll do some more experiments tomorrow to see if I can more precisely define a use case.

However, something else I think occurred which surprised me.  When GIMP 2.8 exports files to various formats the metadata is lost.  However, GIMP 2.10 is exporting files that include the metadata from an original photograph.  Interestingly when I exported the tif file using GIMP 2.10 by opening the xcf file created by GIMP 2.8 it did include the metadata.  In that, GIMP 2.8 must save the metadata when it saves a file in xcf format.  This could turn out to be a good thing from my point of view.
Reply
#5
The steps to a pretty straightforward experiment that reproduced the problem are the following:

  1. Using GIMP 2.8 open a camera developed jpg file.
  2. Perform a simple crop (i.e., some editing).
  3. Create a saved xcf type file.
  4. Export the image to a tif type file (Compression = "None")
  5. Close GIMP 2.8
  6. Start GIMP 2.10
  7. Verify that the tif type file created above can be opened and then close view
  8. Open the xcf file previously created by GIMP 2.8
  9. Export the image to a tif type file (Compression = "None", Advanced options all checked)
  10. Close view
  11. Open the tif type file just created by GIMP 2.10 (using GIMP 2.10)
  12. Error occurs
Interesting is that the tif type file created by GIMP 2.8 (Step 4 above), which can be opened using GIMP 2.10, contains practically no metadata.  Whereas the tif type file created by GIMP 2.10 (Step 9 above), which fails to open using GIMP 2.10, contains lots of metadata (i.e., comparable to the camera developed jpg file).  Using ExifTool to examine the metadata in all 3 of the files created in this experiment (2 tif, 1 xcf), none contain an element called "ImageLength".

This observation lead me to try something else which was to use GIMP 2.10 to create (export) a tif type file where the advanced option to create a thumbnail was unchecked (i.e., no thumbnail).  When I subsequently open that tif file using GIMP 2.10 the error regarding invalid "ImageLength" is displayed but the file IS successfully opened.  In that, the problem appears related to the thumbnail.  Therefore, using GIMP 2.10 I opened the camera developed jpg file and exported as tif type as above but with thumbnail.  This worked fine which again brings us back to the point that the GIMP 2.8 xcf still appears to be a factor.
Reply
#6
(05-04-2018, 03:18 PM)ajax Wrote: This observation lead me to try something else which was to use GIMP 2.10 to create (export) a tif type file where the advanced option to create a thumbnail was unchecked (i.e., no thumbnail).  When I subsequently open that tif file using GIMP 2.10 the error regarding invalid "ImageLength" is displayed but the file IS successfully opened.  In that, the problem appears related to the thumbnail.  Therefore, using GIMP 2.10 I opened the camera developed jpg file and exported as tif type as above but with thumbnail.  This worked fine which again brings us back to the point that the GIMP 2.8 xcf still appears to be a factor.

Further observation is that when exporting tif type files under GIMP 2.10 there is an "Advanced Option" that allows to include or exclude the thumbnail.  This option does not appear when exporting with GIMP 2.8.  It seems that no matter what is specified when you go to open the file using GIMP 2.10 you are asked to select from what is called Page "1" or "2".  I presumed that this refers to both the image and the thumbnail.  It seems that the failure to open only occurs when selecting "2" and it now looks to me like "1" refers to full image.  I'm must admit some uncertainty when it comes to what is meant by "1" and "2".
Reply
#7
Ok, while you were writing that, I followed your procedure through.

A video recording: https://youtu.be/KZZJXd5pwGw 3 and a half minutes.

The thumbnail (page 2) does fail, but metadata with Gimp (any version) is still not wonderful and I suggest using some other application such as exif tool if you desperately need to save metadata.
Reply
#8
(05-04-2018, 04:25 PM)rich2005 Wrote: Ok, while you were writing that, I followed your procedure through.

A video recording: https://youtu.be/KZZJXd5pwGw  3 and a half minutes.

The thumbnail (page 2) does fail, but metadata with Gimp (any version) is still not wonderful and I suggest using some other application such as exif tool if you desperately  need to save metadata.

I think the video confirms what I found.  As previously mentioned I was dealing with some uncertainty regarding the difference between Page 1 & Page 2.  My intuition caused me to think that the primary image was Page 2 whereas now I believe it is Page 1.  More certainty was displayed in the video where Page 1 was first selected when importing the GIMP 2.10 created tif file whereas as I first selected Page 2.

While the thumbnail is not something that I particularly care about insofar as I now see how to open the real image I do think that being able to create correct tif files is extremely important.  This is what I expect to be the final form for edited images that I'd like to be able to share.  The reason I choose NO compression is precisely to maximize compatibility with other software (i.e., the compression algorithms are by no means universally supported).  The fact that there is at least one very widely distributed viewer that cannot open a tif file created by GIMP does suggest to me that there is something wrong with at least some tif files produced (exported) by GIMP 2.10 and that this problem ought to be corrected.

I offer some speculation.  My limited experience seems to isolate the problem to the situation where it only occurs when GIMP 2.10 has opened an xcf file created by a prior version of GIMP.  Insofar as prior versions of GIMP make no mention of thumbnails might it be that they do NOT have support for thumbnails?  If so, is it possible that this causes GIMP 2.10 to do something unintended with respect to thumbnails when processing xcf files created by prior versions of GIMP?

When it comes to metadata I have made some attempt to use ExifTool to export from an original camera developed jpg file to a tif type file created by GIMP 2.8 which basically has no metadata.  This is still in the experimental stages for me but I have determined that some care is required.  It is possible to screw up how other software displays images even though GIMP has no problem.  For example, cameras can be held in different positions when photos are shot.  It looks like orientation metadata is used to help with display of such images.  Images created by GIMP tend to have intended orientation but updating this element of metadata can have very strange affects on what is displayed in some viewers that have nothing to do with orientation.

I was hoping that GIMP could recognize where the incoming values conflict with changes made during editing and get corrected in such a way that other software is at minimum able to properly display an image.  The idea being that when the image we're creating with GIMP is an enhanced/refined photograph let's try to preserve relevant metadata.  I've not yet experienced any problems associated with the metadata output by GIMP 2.10 but you seem to be suggesting this could easily happen.  It also looks to me like even though GIMP claims to be able to edit metadata this is a somewhat selective process and doesn't apply to all of the metadata.
Reply
#9
It looks like there is workaround for this problem.  When GIMP 2.10 is used to load/open, the image (i.e., Page 1), of the defective tif file that it has created (per above discussion) it can then export to another tif file which seem to be free of the defect.  Insofar as the tif format preserves the full quality of the image, I'm thinking, this second copy is as good as the first.  Unlike the defective tif file this secondary instance can be opened by all of the viewers at my disposal without incident.

Speculation is that this removed whatever role the xcf file, from the prior version of GIMP, played in creating the problem.
Reply


Forum Jump: