Image handling dependent on class?!

Author Message

Thomas Brandl

Tuesday 09 September 2003 9:05:32 am

Hi,

I guess this is a rather a suggestion than a question:
Can I define image-convert-commands per class, so that I can use different convert-options dependent on a class-id the image-datatype was used in?

Say, I have a class "free pictures" and "copyright pictures" both with name, caption and image-(datatype).

Now I want all "free picture"-images automatically have a border around them and all copyright pics should be merged with another image with some watermark.

I don't actually need this right now, but it would come in very handy for a couple of situations! (and I'd feel better, if I knew it WOULD be possible!)

Paul Forsyth

Tuesday 09 September 2003 10:29:48 am

I think the current image settings apply to all images so you cannot apply different settings per class. It would be a nice concept to have image settings being overriden by a siteaccess override file :) That would be ideal. Then you could match by class or anything else for that matter.

For the moment though it looks like you need to write some php code to achieve this. Shouldn't be too hard as all you need to do is replace the ini setting for convert with your own calls.

You may also want to consider pre-processing your images before putting into the ez system. The original images can still be accessed by users. You want to create new variations but having the original on the system will defeat the purpose and be a security problem. Pre-processing your images means that users can never have access to the originals.

Paul

Bjørn Kaarstein

Tuesday 09 September 2003 10:49:12 pm

Wouldn't it be possible to use a switch/case statement based on class directly in your view template?

Then you could display one class with a border and use the texttoimage operator on your other class, to create a watermark?

http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/image_handling

Or is it more to it than I think?

Regards Bjørn

Paul Forsyth

Wednesday 10 September 2003 12:23:18 am

I didn't realise texttoimage could do all of that. Nice!

However, the problem is about native images first. It would be nice to somehow allow parameters of convert, gd through to ez so you could do what you want :) At the moment it is coded into an ini file which applies globally :(

The security problem I mentioned still remains though.

Paul

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 01:23:40
Script start
Timing: Jan 31 2025 01:23:40
Module start 'layout'
Timing: Jan 31 2025 01:23:40
Module start 'content'
Timing: Jan 31 2025 01:23:40
Module end 'content'
Timing: Jan 31 2025 01:23:40
Script end

Main resources:

Total runtime0.0313 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 589.2656151.2109
Module start 'layout' 0.00910.0047 740.4766220.6875
Module start 'content' 0.01380.0159 961.1641997.6641
Module end 'content' 0.02970.0015 1,958.828133.9922
Script end 0.0313  1,992.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00278.6522140.0002
Check MTime0.00113.5852140.0001
Mysql Total
Database connection0.00072.360710.0007
Mysqli_queries0.007022.379930.0023
Looping result0.00000.054110.0000
Template Total0.00113.610.0011
Template load0.00092.762710.0009
Template processing0.00030.798810.0003
Override
Cache load0.00061.912910.0006
General
dbfile0.00103.087980.0001
String conversion0.00000.025940.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