GNOME Bugzilla – Bug 739124
Add TIFF support
Last modified: 2016-03-20 21:23:15 UTC
Similarly to the JPEG and PNG loaders, gegl should support TIFF (including multi-page handling).
Started to write a TIFF loader. You'll find my branch here: https://gitlab.com/tchaik/gegl/blob/tchaik/wip/tiff/operations/external/tiff-load.c Code is inspired from GIMP's file-tiff-load.c and GdkPixbuf's io-tiff.c. Some more work needs to be done, of course (this is a work in progress), but basics are working. Early comments are welcome, I'm neither a GEGL nor a TIFF expert...
Assuming that it loads many TIFFs, and TIFFs behind a notoriously hard container format to get good coverage for - perhaps we should take what you currently have in your branch and add it to upstream?
Agreed, loader and saver are in quite a good shape now, but saver will required bug #752037 to be reviewed first. Anyway, how should we proceed? Should I post patches here? Do you prefer to have everything squashed in one patch?
One git-formatted patch for the loader and one for the saver would be great. There should also be at least one composition test per op, so we are sure it continues to work (and on all platforms). See for example https://github.com/GNOME/gegl/blob/master/tests/compositions/pnm-ascii-load.xml and the associated 'pnm-ascii-load.png' under https://github.com/GNOME/gegl/tree/master/tests/compositions/reference When you've added the .xml 'make check' will run it, and write output to './tests/compositions/out/$name.png'. You manually verify that it looks correct, and then copy over to reference dir. Running test again should then pass.
Created attachment 312583 [details] [review] Add a gegl:tiff-load operation Here is for the loader, test file and resources have been included.
Created attachment 312584 [details] [review] Add a gegl:tiff-save operation And here is for the saver.
commit 319a91e3f09a58ed3fd42a71d256725f0efdd7b5 Author: Martin Blanchard <tchaik@gmx.com> Date: Fri Oct 2 22:38:58 2015 +0200 tiff: Add a gegl:tiff-save operation New GIO based TIFF file saver using libtiff. Operation will try to preserve the original buffer's data as much as possible, avoiding conversions. Based on GIMP's file-tiff-save plugin. https://bugzilla.gnome.org/show_bug.cgi?id=739124 commit 4a47d55d09c6d033ff62220c6c482f9f016f233c Author: Øyvind Kolås <pippin@gimp.org> Date: Sat Nov 21 03:59:46 2015 +0100 POTFILES: add tiff-load.c commit ae739a08a9902a7d3b4c660c83ef5b2b1c170920 Author: Martin Blanchard <tchaik@gmx.com> Date: Fri Oct 2 21:38:44 2015 +0200 tiff: Add a gegl:tiff-load operation New GIO based TIFF file loader using libtiff. Handles contiguous and separated planar configuration, integer and floating-point samples and various sample bit depth. Test file + resources are included. Based on GIMP's file-tiff-load plugin. https://bugzilla.gnome.org/show_bug.cgi?id=739124
Created attachment 324388 [details] [review] Do not pass warning strings directly to printf function
(In reply to Martin Blanchard from comment #8) > Created attachment 324388 [details] [review] [review] > Do not pass warning strings directly to printf function pushed to git