You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Grzegorz Tañczyk <go...@polzone.pl> on 2005/01/11 11:55:01 UTC

Re[2]: Reduce image size in databasereader?

Hello george,

  ImageReader should be improved because two parameters: width and
  height funcionality is limited:
     * The behavior is the following: if both the new width and height values
     * are positive, the image is rescaled according to these new values and
     * the original aspect ration is lost.
     * Otherwise, if one of the two parameters is zero or negative, the
     * aspect ratio is maintained and the positive parameter indicates the
     * scaling.
     * If both new values are zero or negative, no scaling takes place (a unit
     * transformation is applied).
  There should be aditional parameter "keepRatio", because it is
  impossible to guess if uploaded image is wider or higher. For
  example I want to make thumbnails not wider than then 100 and not
  higher than 70. I have to chain to imagereader with second
  imagereader? It will kill performance on site with lots of uploaded
  images :)

Tuesday, January 11, 2005, 8:32:59 AM, you wrote:
gg> You can achieve the same result by chaining the already existing
gg> imagereader with the databasereader, thus having the databasereader read
gg> the image and the imagereader scale it.

gg> I use the following (beware that in 2.1.5 this leaks database 
gg> connections, fixed in 2.1.6):
gg> [cut]

-- 
Best regards,
 Grzegorz                            mailto:goliatus@polzone.pl


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Re[2]: Reduce image size in databasereader?

Posted by Mark Lundquist <ml...@wrinkledog.com>.

> -----Original Message-----
> From: Grzegorz Tañczyk [mailto:goliatus@polzone.pl]
>
> Hello george,
>
>   ImageReader should be improved because two parameters: width and
>   height funcionality is limited:
>      * The behavior is the following: if both the new width and
> height values
>      * are positive, the image is rescaled according to these new
> values and
>      * the original aspect ration is lost.
>      * Otherwise, if one of the two parameters is zero or negative, the
>      * aspect ratio is maintained and the positive parameter indicates the
>      * scaling.
>      * If both new values are zero or negative, no scaling takes
> place (a unit
>      * transformation is applied).
>   There should be aditional parameter "keepRatio", because it is
>   impossible to guess if uploaded image is wider or higher. For
>   example I want to make thumbnails not wider than then 100 and not
>   higher than 70.

There is a patch for this:
http://issues.apache.org/bugzilla/show_bug.cgi?id=30417

For some reason that I lost track of, this hasn't been committed yet...
thanks for the reminder and I will try to get that loose end tied up :-)

Note, there are two patch files there... take only the second one.

> Tuesday, January 11, 2005, 8:32:59 AM, you wrote:
> gg> You can achieve the same result by chaining the already existing
> gg> imagereader with the databasereader, thus having the
> databasereader read
> gg> the image and the imagereader scale it.

Yes, that is totally the way to do it.

HTH,
-ml-



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org