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.