Image upload: how to limit the size/weight of original

Author Message

Piotrek Karaś

Thursday 04 October 2007 1:46:49 am

Hello,

The way I understand eZ Publish works with images is that it stores/keeps the uploaded original image of permitted weight (min. 1MB), which it uses for further resizing according to image presets and configuration.

Unfortunately, not all sites require an original of up to 1MB (which is comparatively a lot). Is there a way to setup eZ Publish to manipulate/resize the original, just as other image presets are?

For example: user uploads a large image of 1MB which automatically gets resized to 800x800px or 200KB and from then on taken as original for further use.

Or do I miss something?

Thanks!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Kristof Coomans

Thursday 04 October 2007 7:37:21 am

Hi Piotrek

I found this in settings/image.ini:

# By defining the 'original' alias and setting some filters
# or changing the MIME type you can even force a conversion of
# the originally uploaded image.
# This is useful to save space or make sure the image is in a specific format
# [original]
# Filters[]
# Filters[]=colorspace/gray

I hope this helps you getting on the right track :)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Piotrek Karaś

Thursday 04 October 2007 8:49:11 am

I have no idea how we've missed it ;) Amateur mode ;)
Well, that exactly it and working fine, even in my fresh and fast installation of eZ4alpha ;)
Thanks!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Andy Caiger

Wednesday 07 April 2010 12:19:04 am

So what should go in image.ini to force all uploaded original images to automatically get resized to 200KB? The geometry filter allows us to change the dimensions of the image in pixels or by a percentage, but what about the number of bytes used?

EAB - Integrated Internet Success
Offices in England, France & China.
http://www.eab.co.uk http://www.eab-china.com http://www.eab-france.com

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 18 2025 05:20:02
Script start
Timing: Jan 18 2025 05:20:02
Module start 'layout'
Timing: Jan 18 2025 05:20:02
Module start 'content'
Timing: Jan 18 2025 05:20:03
Module end 'content'
Timing: Jan 18 2025 05:20:03
Script end

Main resources:

Total runtime1.2161 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.1953152.6406
Module start 'layout' 0.00780.0192 741.835939.4766
Module start 'content' 0.02701.1877 781.3125598.2734
Module end 'content' 1.21460.0014 1,379.585916.4375
Script end 1.2160  1,396.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2731160.0002
Check MTime0.00130.1057160.0001
Mysql Total
Database connection0.00140.116810.0014
Mysqli_queries1.136393.4404620.0183
Looping result0.00060.0515600.0000
Template Total1.025984.420.5130
Template load0.00250.201820.0012
Template processing1.023584.160620.5117
Template load and register function0.00010.009010.0001
states
state_id_array0.02812.311810.0281
state_identifier_array0.00560.458120.0028
Override
Cache load0.00190.1583240.0001
Sytem overhead
Fetch class attribute can translate value0.00050.041430.0002
Fetch class attribute name0.00120.097870.0002
XML
Image XML parsing0.00140.118830.0005
class_abstraction
Instantiating content class attribute0.00000.001280.0000
General
dbfile0.00130.1103290.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs