Closed amr66 closed 2 years ago
@amr66 Could you download the resulting image and attach that to this ticket?
@szekerest thank you, here it is:
@amr66 pngcheck says that the file is corrupted by text conversion. I'm not sure however it has happened during the png creation or when it was saved to the file. Could you provide some test data to reproduce this problem? If you open a gisinternals command prompt and run mapserv from the command line, does it provied correct result? Something like:
mapserv -nh "QUERY_STRING=map=/gims/mapserver/test/regio_tr.map&mode=map" > sample.png
@szekerest sure, this is the output file:
Another simple example is the "Hello World"-map file, ignore the template, it is called with mode=map of course
MAP
NAME HELLO
STATUS ON
EXTENT 0 0 4000 3000
SIZE 400 300
IMAGECOLOR 180 60 255
WEB
IMAGEPATH "/gims/mapserver/test/ms_tmp/"
IMAGEURL "/test/ms_tmp/"
TEMPLATE "/gims/mapserver/test/hw.htm"
END
LAYER
STATUS default
TYPE point
FEATURE
POINTS 2000.00 1500.00 END
TEXT "Hello World. Mapserver rocks."
END # end feature
CLASS
STYLE
COLOR 255 0 0
END
LABEL
TYPE bitmap
END
END
END
END
@amr66 - any difference if you add a specific IMAGETYPE of png
to the Mapfile?
Good Idea!
OUTPUTFORMAT
NAME "jpeg"
DRIVER AGG/JPEG
MIMETYPE "image/jpeg"
IMAGEMODE RGB
EXTENSION "jpg"
END
It shows the image, but it looks weird .
Checked the wrong output and it seems that the stdout is not being switched to binary mode so extra 0x0D bytes are inserted into the image. Looks like we need to patch libfcgi to get it working as per: https://github.com/MapServer/MapServer/issues/1153
I'll apply that fix and trigger a new build with that.
I can confirm, that replacing libfcgi.dll from an osgeo4w install with same 64-bit MSVC 2019 (in my case) works.
@szekerest - could this also be the cause of https://github.com/MapServer/MapServer/issues/6459 ?
@geographika yes, definitely
Recompiled the release versions https://www.gisinternals.com/release.php It seems that the problem was fixed.
Thank you for your quick fix. It works!
Thank you, closing this
I run gisinternals mapserver with an Apache24 under win10. When I request a map with a html template and mode=browse everything works fine but if I try to use mode=map I get an error in my browser (Firefox): 'Die Grafik "http://localhost:8008/ms-bin/mapserv.exe?map=/gims/mapserver/test/regio_tr.map&mode=map" kann nicht angezeigt werden, weil sie Fehler enthält.' (The Image ... can't be displayed, because it contains errors). I don't see any errors in the Apache log files nor in the mapserver debug logs. I'm not completly sure if this error belongs to mapserver or to the apache config.