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.

eZ debug

Timing: Jan 31 2025 03:36:37
Script start
Timing: Jan 31 2025 03:36:37
Module start 'layout'
Timing: Jan 31 2025 03:36:37
Module start 'content'
Timing: Jan 31 2025 03:36:37
Module end 'content'
Timing: Jan 31 2025 03:36:37
Script end

Main resources:

Total runtime0.0345 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.2344151.2109
Module start 'layout' 0.00610.0117 739.4453220.6875
Module start 'content' 0.01780.0150 960.13281,005.9297
Module end 'content' 0.03280.0017 1,966.062537.9922
Script end 0.0345  2,004.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00298.2699140.0002
Check MTime0.00113.1666140.0001
Mysql Total
Database connection0.00082.350610.0008
Mysqli_queries0.00318.948430.0010
Looping result0.00000.031810.0000
Template Total0.00133.710.0013
Template load0.00102.846010.0010
Template processing0.00030.860910.0003
Override
Cache load0.00071.920810.0007
General
dbfile0.00123.612380.0002
String conversion0.00000.031840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs