image scaling based on larger side

Author Message

Marko Žmak

Wednesday 29 August 2007 7:28:56 am

I'm creating a web gallery on my eZ site and I have this problem...

I need eZ to resize my images based on the longer size of image. So, for example I have two pictures, on vertical with dimensions 600x800 and one horizontal with dimensions 800x600. I need eZ to resize the vertical picture to 480x640 and horizontal to 640x480.

As I've seen so far, there's no INI setting in image.ini that can do something like this. Is there any possiblity to do this with eZ?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Frédéric DAVID

Wednesday 29 August 2007 9:25:19 am

Hello,

you can find some response for your problem there :
http://ez.no/download/ez_publish/changelogs/ez_publish_3_3/new_image_system

# geometry/scalewidthdownonly=width- Scale image to have a width of width while maintaining aspect ratio, if the image is smaller than the given size no scaling is done
# geometry/scaleheightdownonly=height- Scale image to have a height of height while maintaining aspect ratio, if the image is smaller than the given size no scaling is done
#geometry/scaleexact=width;height - Scale image to width and height without maintaining aspect ratio

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Marko Žmak

Wednesday 29 August 2007 10:22:13 am

No this doesn't solve my problem.

The thing that I need is to resize the loner side to the specified size, and then resize the other side according to that respecting the aspect ratio. None of these settings for image conversion can do this.
As far as I've seen there's no setting that does this.

Does someone know the sollution to this problem?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

André R.

Wednesday 29 August 2007 11:18:34 am

Won't this do the job ?

Filters[]=geometry/scaledownonly=640;640

So the largest size will be 640.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marko Žmak

Wednesday 29 August 2007 12:08:19 pm

Yes Andre this does the job. I misunderstood what geometry/scaledownonly does. I tought it will scake down both sides to that size.

But now I have another problem. I would like to scale down the SHORTER side to the specified size and resize the other side respecting the aspect ratio. For example I would like to scale down two images of unknown dimensions to have the shorter side exactly 300px.

How can I do that?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

André R.

Wednesday 29 August 2007 2:35:40 pm

Not possible to my knowledge.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.