Feature #20497
closedNew options noRescale and resoultionFactor for getImgResource()
0%
Description
Sometimes a higher resolution as the display-resolution of an Image is needed.
E.g. if you want to render PDFs from your HTML-Output, you coulld need higher resolutions for images, if you want to print them.
This is not possible in the moment.
New options for the imgResource that would be helpful:
noRescale=1 -> creates image, as ususal, but doenst resize original file
resolutionFactor=n -> creates an image, that has n times higher resoultion than displayed
Imagine an uploaded Image of size 1500x1000 pixel.
If you create an IMAGE-Tag by TS with width=320m, then the Image will be rendered to 480x320 pixels and the width/height-params of the created <img>-tag will be also 480x320.
If you want to zoom-in on the website or you want to create a PDF from the page, then the resolution is to low.
With use of noResize=1an IMAGE-Tag will be rendered with width/height-params 480x320, but the src-param will be the original image (having 1500x100 pixels).
With use of resolutionFactor=2 an IMAGE-Tag will be rendered with the Image scaled to 960x640 pixels and the width/height-params of the created <img>-tag set to 480x320.
(issue imported from #M11177)
Files
Updated by Stefan Geith over 15 years ago
See http://geithware.de/rfc11177.html for the TS-Example
Updated by Stefan Geith over 15 years ago
Franz Koch suggested to use a real resulution-property.
Patch v2 implements this and TS v2 is the demo TS for this new patch.
Result can be seen at http://geithware.de/rfc11177.html
Updated by Stefan Geith about 15 years ago
New with pathch v2:
- Now a resolution-parameter is used. the resize-width is caluclated by width = width * resolution / 72
- resolutions below 36dpi will be treated as if no resolution-parameter is set
- If no resolution parameter is given, functionality does not change: IM/GM renders the requested image-size. NOTE: the resolution that is stored within the jpg-file, will always be the same, as in the original file.
- If resolution=72 is set, the image is rendered as before, but the resolution that is stored within the jpg-file is set to 72 dpi (!)
- for other resolutions, the image is rendered proportionally bigger and the resolution that is stored within the jpg-file is set to the requested resolution (!)
- if the resolution-parameter would require the image to be upscaled, then the original image will be returned, because upscaling doesnt make sense.
Updated by Stefan Geith over 14 years ago
11177_noscale.patch misses to transfer 'noScale' to the options array.
11177_noscale_v2.patch ist working.
Updated by Benni Mack almost 14 years ago
- Committed the noScale patch (v3) to trunk (rev. 9371)
- Added your documentation to the pending documentation wiki page
- Created a new patch and a new bug report for the "resolutionFactor"
feature. (http://bugs.typo3.org/view.php?id=16375) - please send it to
the core list.
Updated by Chris topher over 13 years ago
Committed in 454ef25a04d1bb228f0eeb97f43adbd87cacf4db