[gdal-dev] JPEG compression in TIF doesn't work

Smith, Michael Michael.Smith at maine.gov
Fri Dec 19 15:14:54 EST 2008


C:\nwdoqs>gdalinfo test_jpeg100_tif.tif

Driver: GTiff/GeoTIFF
Files: test_jpeg100_tif.tif
       test_jpeg100_tif.aux
Size is 9728, 13963
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-69],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26919"]]
Origin = (451821.274973547090000,5135906.297448008300000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Metadata:
  AREA_OR_POINT=Point
  TIFFTAG_SOFTWARE=Arc/Info
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Image Structure Metadata:
  COMPRESSION=JPEG
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  451821.275, 5135906.297) ( 69d37'35.22"W, 46d22'30.06"N)
Lower Left  (  451821.275, 5121943.297) ( 69d37'30.07"W, 46d14'57.69"N)
Upper Right (  461549.275, 5135906.297) ( 69d29'59.88"W, 46d22'32.30"N)
Lower Right (  461549.275, 5121943.297) ( 69d29'55.76"W, 46d14'59.92"N)
Center      (  456685.275, 5128924.797) ( 69d33'45.23"W, 46d18'45.05"N)
Band 1 Block=9728x16 Type=Byte, ColorInterp=Gray
  Metadata:
    LAYER_TYPE=athematic


**********
Michael Smith
State GIS Manager
Maine Office of GIS 
-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Friday, December 19, 2008 2:23 PM
To: Smith, Michael
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] JPEG compression in TIF doesn't work

Smith, Michael wrote:
> I have an 8-bit tif aerial photo, when I try to compress it with JPEG
> compression in any of the following examples:
> 
> gdal_translate -ot Byte -of GTiff -co "COMPRESS=JPEG" -co
> "JPEG_QUALITY=100" allagash-lake.tif test_jpeg100_tif.tif
> gdal_translate -ot Byte -of GTiff -co "COMPRESS=JPEG" -co
> "JPEG_QUALITY=20" allagash-lake.tif test_jpeg20_tif.tif
> gdal_translate -ot Byte -of GTiff -co "COMPRESS=JPEG"
allagash-lake.tif
> test_jpeg_tif.tif
> 
> I get the error message:
> 
> Warning 1: JPEGLib:Application transferred too many scanlines
> 
> And there is a small part at the bottom where the rows are all value 0
> (and they shouldn't be).  Looks like it skips the last 11 rows and
sets
> them all to 0 (in an image that is 9728c x 13963r)

Michael,

What is the size of your input image in pixels and lines?

What does the gdalinfo report on the output file look like?

Best regards,
-- 
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list