[TYPO3-core] RFC #11177: Feature: New options noRescale and resolutionFactor for getImgResource()

Stefan Geith typo3dev2008.nospam1 at geithware.de
Mon Aug 24 14:08:07 CEST 2009


Steffen Ritter schrieb:
> generally +1 by reading

Thanks !

> but one question bothers me... setting the "dpi" tag of an image makes 
> sense. but changing the pixel size does not... dpi is the "transform" 
> from cm/inches to pixel... so to me this only makes sense if you deal 
> with cm sizes... why sould you say i want an image 200x200px if you 
> reallay want 2500x2500?
> saying get me an image 2500x2500 setting dpi to 300, so that an 
> graphicssoftware will have the right measures makes sense to me...
> 
> So what's the sense behind that? Or the use case of this behavoiur...

The central point is this:

Normally when images are resized in Typo3, there is nothing like 'dpi' 
used, because each pixel in the file shows on one pixel on the screen.
So an image with 640x480 pixels is shown with
     <img ... width="640" height="480">
- the dpi-setting doesn't matter: the width/height params are _always_
set to the number of pixels in the file.

Q: What happens, when I print this from my browser (or when I print a 
PDF generated from this with pdf_generator) ?
A: I get this image printed with about 72dpi (more or less), this means, 
I can count the pixels on the paper with my eyes ...

So I need a way to render an Image-Tag that still contains
    <img ... width="640" height="480">
but the Image is rendered to - lets say - 1280x960 (or more).
cobj->IMAGE() doesn't support this yet.
On screen it looks the same (but there are more Kbytes to transfer) and 
printed it looks much better.

How could/should I confgure this ?
There could be two ways:
1) Because on screen there is nothing like 'dpi', I could use a
    configuration like e.g.
       resolutionFactor=2
    (I made it like this in my first patch)
2) I simply define, that Screenresolution _is_ 72dpi (because in former
    times this was the resolution, images had on screen) and now
    use configuration like e.g.
       resolution=144
    (This does the latest version of the patch - after taking
    Franz Kochs arguments into account)

My Usecase is this:
A client wants to have Product-Pages, that can be downloaded as PDFs 
(generatd by pdf_generator).
In TS I would do simply something like
   [globalVar = TSFE:type = 123] // Page rendered as PDF
      ...
      resolution=144
      ...
   [GLOBAL]
to get PDFs with un-pixeling images printed.
Page in Webbrowser still has normal (=smaller =72dpi) images.


Hope, this clarifies my needs ;)



/Stefan






> regards
> 
> Steffen
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
> 
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/ 
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-core



More information about the TYPO3-team-core mailing list