Wednesday 27 October 2010 7:31:20 pm
Hi there, I am very much new to using ez publish and to the community. Learning and enjoying though :-). Following is the scenario and questions. Scenario: I created separate siteaccess for one of the sites to serve content for mobile handsets. Problem is with images. Not all handsets are of the same width and height. So i built an interface to get the handset width and height. Now i need a way to resize the images on the fly based on the handset width and height so that they can be rendered properly. If this was in PHP i have used imagemagick convert command to resize the image and dropped the resized file in a DIR. But using EZPUb how can i achieve this. Reason i ask, the place where my clients site is hosted does not have imagemagick. Ideally, this is what i would like to happen. 1. Create a custom php template operator 2. Pass source path, file name, width, height, destination path 3. Now, the operator should take care of converting the image based on the image processing lib available (GD/ImageMagick) 4. Drop the resized/converted image in a destination folder provided 5. Return true/false My understanding is, ez publish (ezimage) has a process of finding out what library is available for image manipulation and uses it accordingly. Questions 1. Is it possible for me to mimic/simulate the same functionality as ezimage, in a way, that my template operator finds out what lib is available and use it accordingly? 2. If its possible HOW? 3. If its NOT possible then how can i dynamically resize/convert the images on the fly. Can’t use Filters here as we don’t know the sizes of screen until the request comes in. 4. Is there any better approach than what i mentioned above Thanks in advance guys Cheers RD
|