[Mapserver-users] GDAL Can't read JPEG files

Sean Kleinjung sean at satshot.com
Tue Mar 30 23:50:13 EST 2004


--=-3a253U5LX7SiC256NixQ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello everyone,

I am trying to set-up our MapServer to access and display imagery from
the TerraServer web service. I managed to figure out the mapfile
configuration, and got everything setup correctly (I think). MapServer
is built with WMS client support, etc.

When attempting to display a map containing the terraserver layer, I get
the following error:

---------------------------------------------------------------------
msDrawMap(): Image handling error. Failed to draw layer named
'terraserver'. <br>
msDrawRaster(): Image handling error. Unrecognized or unsupported image
format <br>
drawEPP(): Image handling error.
/home/httpd/html/webmap/images/1080697505325520.img.tmp is not an EPPL
file. <br>
---------------------------------------------------------------------

I searched the mailing list archive, and found in particular the posts
concerning invalid image scales causing this error. I double-checked my
scale data, and changed it where appropriate. Just to make sure, I
manually entered a request to the web service using my map extents. This
returned an image as planned.

Thus I went back to mapserver, fairly confident that the image it was
recieving from TerraServer was correct. The EPPL message was rather
confusing, since I was expecting a JPEG from TerraServer. I just assumed
that MapServer was for some reason storing its temp file in this format
(?). 

When nothing turned up, I looked at the mapserver source for answers. I
noticed that the EPPL message is a default displayed if GDAL fails to
load the image, even if it isn't an EPPL source. (This is kind of odd
behavior, btw.) So I am now left assuming that GDAL can't open the JPEG
for some reason.

I went to terraserver and manually downloaded a map .jpeg, and ran
gdalinfo on it. This gave me the following error:

---------------------------------------------------------------------
# ./gdalinfo test.jpg
ERROR 4: `test.jpg' not recognised as a supported file format.

GDALOpen failed - 4
`test.jpg' not recognised as a supported file format.
---------------------------------------------------------------------

Interestingly, .jpg is the output format I am using for my maps, and the
above error is also displayed if I run gdalinfo on a .jpg that mapserver
itself created.

Following is some mapserver and gdal version information:
---------------------------------------------------------------------
# mapserv -v
MapServer version 4.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=JPEG INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE
# gdal-config --version
1.1.9
# gdal-config --formats
gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 bsb xpm sdts raw dted
mem jdem envisat elas fit vrt usgsdem l1b nitf bmp jpeg2000 gif jpeg png
#
---------------------------------------------------------------------

As you can see, jpeg support should be there. Any insight into this
problem would be greatly appreciated.

Thanks for your time,
Sean Kleinjung
Web Application Developer
Agri ImaGIS Technologies, Inc.
http://www.satshot.com


PS: Kind of off-topic, but I'm not really sure where this kind of thing
should go. When I was poking around in the source, I noticed an error
message that was a bit misleading. It looks like it was copied and
pasted from the one above it. I suggest applying the attached diff to
the 1.109 revision of mapraster.c to clarify this.



--=-3a253U5LX7SiC256NixQ
Content-Disposition: attachment; filename=msg.patch
Content-Type: text/plain; name=msg.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

1343c1343
<     msSetError(MS_MISCERR, "Attempt to render raster layer to IMAGEMODE RGB or RGBA but\nwithout GDAL available.  24bit output requires GDAL.", "msDrawRasterLayer()" );
---
>     msSetError(MS_MISCERR, "Attempt to render raster layer that requires reprojection\nwithout GDAL available.  Image warping requires GDAL.", "msDrawRasterLayer()" );        

--=-3a253U5LX7SiC256NixQ--




More information about the mapserver-users mailing list