Opened 16 years ago

Closed 15 years ago

#1357 closed enhancement (fixed)

[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:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

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

Attachments (2)

Pyramid.jpg (175.1 KB ) - added by pcav 16 years ago.
ticket1357_detect_libtiff4.patch (1.3 KB ) - added by rouault 15 years ago.

Download all attachments as: .zip

Change History (12)

by pcav, 16 years ago

Attachment: Pyramid.jpg added

comment:1 by ersts, 15 years ago

Owner: changed from nobody to ersts
Status: newassigned

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

comment:2 by pcav, 15 years ago

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

comment:3 by ersts, 15 years ago

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.

comment:4 by pcav, 15 years ago

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

comment:5 by ersts, 15 years ago

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.

comment:6 by ersts, 15 years ago

Resolution: fixed
Status: assignedclosed

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

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

comment:7 by rouault, 15 years ago

Milestone: Version 1.0.0
Priority: critical: causes crash or data corruptionminor: annoyance or enhancement
Resolution: fixed
Status: closedreopened
Type: bugenhancement

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.

by rouault, 15 years ago

comment:8 by rouault, 15 years ago

Summary: pyramids> reddish files[PATCH] Build overview for Jpeg-in-TIFF file only if GDAL uses libtiff >= 4.0

comment:9 by pcav, 15 years ago

Milestone: Version 1.2.0

comment:10 by ersts, 15 years ago

Resolution: fixed
Status: reopenedclosed

The patch has been applied, r11187.

Thanks rouault.

Note: See TracTickets for help on using tickets.