Ticket #1357 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

[PATCH] Build overview for Jpeg-in-TIFF file only if GDAL uses libtiff >= 4.0

Reported by: pcav Owned by: ersts
Priority: minor: annoyance Milestone: Version 1.2.0
Component: Rasters Version: Trunk
Keywords: Cc:
Platform Version: Platform: All
Must Fix for Release: No Awaiting user input: no

Description

Pyramids cause tiff files to become reddish, and the lower right quadrant is not completed

Attachments

Pyramid.jpg Download (175.1 KB) - added by pcav 5 years ago.
ticket1357_detect_libtiff4.patch Download (1.3 KB) - added by rouault 4 years ago.

Change History

Changed 5 years ago by pcav

Changed 5 years ago by ersts

  • owner changed from nobody to ersts
  • status changed from new to assigned

Could you provide a little more background? 1) pyramids were built internal or external? 2) which resampling method? 3) is the tif paletted? 4) what OS and version of GDAL are you using?

thanks

Changed 5 years ago by pcav

1) External pyramids seem ok. Internal cause a crash, and the resulting tiff is reddish with the missing tile 2) average 3) GDT_Byte - Eight bit unsigned integer Image Structure Metadata:

COMPRESSION=JPEG INTERLEAVE=PIXEL

4) tested with Debian Lenny, both on 32 and 64 bit, plus 64 bit Fedora; GDAL 1.5.2-3

Changed 5 years ago by ersts

I was able to reproduce. It seems to be size dependent. Pyramids built ok on an 80x80 image but crashed on 8000x8000.

When it crashes I get

--> tif_jpeg.c:691: JPEGPreDecode: Assertion `sp->cinfo.comm.is_decompressor' failed.

So it is a GDAL problem. Will have to look through their tickets to see if this is a known problem.

Changed 5 years ago by pcav

Strange however: apparently GDAL does not crash on the same task when called from the command line

Changed 5 years ago by ersts

I can reproduce the crash from the command line as well.

looks like it is a know problem, that has been closed but not really fixed  http://trac.osgeo.org/gdal/ticket/2033

May have to consider not allowing pyramids to be build for JPEG compressed tifs.

Changed 5 years ago by ersts

  • status changed from assigned to closed
  • resolution set to fixed

-internal pyramid building with compress rasters, specifically JPEG compress is no longer enabled.

This can be re evaluated after libtiff 4+ comes out.

Changed 4 years ago by rouault

  • priority changed from critical: causes crash or data corruption to minor: annoyance or enhancement
  • status changed from closed to reopened
  • type changed from bug to enhancement
  • resolution fixed deleted
  • milestone Version 1.0.0 deleted

Ticket #2033 was closed because the fix for it went to libtiff 4.0 branch, but libtiff < 4.0 has still the issue.

So I'm attaching a patch that enables to build safely overviews on Jpeg files or Jpeg-in-TIFF file by checking that GDAL uses libtiff >= 4.0. The "official" trick to do that is searching 'BIGTIFF' in the creation options of the GTiff driver.

Changed 4 years ago by rouault

Changed 4 years ago by rouault

  • summary changed from pyramids> reddish files to [PATCH] Build overview for Jpeg-in-TIFF file only if GDAL uses libtiff >= 4.0

Changed 4 years ago by pcav

  • milestone set to Version 1.2.0

Changed 4 years ago by ersts

  • status changed from reopened to closed
  • resolution set to fixed

The patch has been applied, r11187.

Thanks rouault.

Note: See TracTickets for help on using tickets.