Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2891 closed defect (fixed)

Map resolution isn't wrote in image files

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords: resolution, dpi, image
Cc: dmorissette, sdlime, warmerdam

Description

The map resolution (DPI) is not wrote in image files. Even if the user specify "resolution 300" in their mapfile, the resolution of the mapfile produced will be 72. The resolution should be wrote in the image file if the format support it. Also, the legend, scalebar and all other images produced by mapserver should use the same resolution as the map image (even PDF, which store images in raw jpeg).

Attachments (2)

2891.patch (16.8 KB ) - added by aboudreault 15 years ago.
resolution-gd-2.0.35.patch (5.3 KB ) - added by aboudreault 15 years ago.
GD 2.0.35 patch for the resolution support

Download all attachments as: .zip

Change History (8)

comment:1 by warmerdam, 15 years ago

What formats, other than PDF, were you hoping would have dpi resolutions in them? I know it is possible in TIFF, but I am not aware of any other format where is it normally included. If we want to include it for TIFF, I can modify msSaveImageGDAL() to set the appropriate metadata items to set the DPI. But I don't - off hand - know how to set it for any other formats.

comment:2 by aboudreault, 15 years ago

Yes, it would be nice to get it for TIFF format. I've made a patch to include this support for PNG and JPEG. I think these 3 formats will be ok for the moment.

by aboudreault, 15 years ago

Attachment: 2891.patch added

comment:3 by aboudreault, 15 years ago

This patch add the support for writing the resolution in all image files with the map resolution setted in the mapfile. Currently, it works for GD and AGG: png and jpeg format.

by aboudreault, 15 years ago

Attachment: resolution-gd-2.0.35.patch added

GD 2.0.35 patch for the resolution support

comment:4 by aboudreault, 15 years ago

Milestone: 5.4 release6.0 release
Resolution: fixed
Status: newclosed

Fix committed in SVN trunk in r8721.

The resolution setted in the mapfile with the RESOLUTION keyword will be wrote in the image files. Currently, that's work for GD/PNG, GD/JPEG, AGG/PNG, AGG/JPEG and GDAL/GTIFF drivers.

The GD patches are available there (i've also attached the patch for gd 2.0.35 in this ticket): http://bugs.libgd.org/?do=details&task_id=176

comment:5 by dmorissette, 15 years ago

For the record, support for writing resolution to TIFF files was added to trunk by Frank in r8723

comment:6 by aboudreault, 15 years ago

The patch 2891.patch has been modified: to be consistent, the imageObj::resolution type has been changed from unsigned int to double. See r8844.

Note: See TracTickets for help on using tickets.