Opened 15 years ago
Closed 15 years ago
#2945 closed defect (wontfix)
GDAL/JPEG driver in MapServer 5.2.x fails
Reported by: | jratike80 | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | MapServer CGI | Version: | unspecified |
Severity: | normal | Keywords: | outputformat |
Cc: |
Description (last modified by )
With Mapserver versions 5.2.0, 5.2.1 and 5.3-dev on Windows XP and obtained from MS4W and FWTools packages, having the following outputformat in mapfile leads to error:
OUTPUTFORMAT NAME "jpeg" MIMETYPE "image/jpeg" DRIVER "GDAL/JPEG" EXTENSION "jpg" IMAGEMODE RGB END
The error, captured from ms errorfile is:
[Tue Mar 17 14:03:47 2009].478000 msSaveImageGDAL(): General error message. Failed to create output JPEG file. JPEG driver doesn't support 4 bands. Must be 1 (grey) or 3 (RGB) bands.
Simple mapfile is included.
Attachments (2)
Change History (6)
by , 15 years ago
Attachment: | outputformat_test.map added |
---|
comment:1 by , 15 years ago
Description: | modified (diff) |
---|---|
Keywords: | outputformat added |
Owner: | changed from | to
comment:2 by , 15 years ago
Status: | new → assigned |
---|
I have slightly simplified the map file, used the data from #2946, and uncommented the GDAL/JPEG output format, and run the command:
shp2img -m outputformat_test.map -o out.jpg
It seems to work fine with mapserver trunk on my linux system. I have also confirmed it works with the latest FWTools build of mapserver on win32. Can you be more specific about how you produce the error?
comment:3 by , 15 years ago
This may be just WMS client error as well. The request that the client is sending is like http://.../cgi-bin/mapserv.exe?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=469&HEIGHT=354&LAYERS=Peltolohkot+2008&TRANSPARENT=TRUE&FORMAT=image/jpeg&BBOX=3402672.4399119024,6925838.864419234,3433757.2239777846,6949301.579897533&SRS=EPSG:3067&STYLES=&map=...
Now what is going on is that TRANSPARENT=TRUE is what makes GDAL/JPEG driver to fail, but GD/JPEG driver returns an image.
comment:4 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Ah, yes, quite true. Requesting TRANSPARENT=TRUE from an RGB imagemode results in it being forced to RGBA imagemode.
I'm not sure if the client is doing something wrong exactly, but this is a bad interaction between how mapserver handles things and what the client is doing.
I assume that GD/JPEG works ok with RGB/TRANSPARENT=TRUE? If so, I'd be inclined not to try and fix GDAL/JPEG which isn't needed most of the time.
I'm going to close this as wontfix for now. Reopen if you think this is serious enough to justify some sort of solution on the mapserver side.
MS mapfile that gives an error