[opencms-dev] dev of auto-img-scale-down-feature for upload.jar in progress, feedback wanted...

Alexander Kandzior alex at opencms.org
Sat Sep 30 09:26:06 CEST 2006


John,

First of all thanks for the ant task to generate the upload applet. I will
add this to the distribution as it makes live certainly easier.

Second, in OpenCms 6.2 there is a feature that allows you to set a image
scale property "image.size" to a folder as well as a global scale parameter.
All images uploaded to this folder are scaled are scaled automatically to
that size after the upload. Please see 

CmsImageScaler
org.opencms.file.types.CmsResourceTypeImage#getDownScaler(CmsObject cms,
String rootPath)

for more details about this feature.

The only downturn of this approach is that the large images are uploaded
first, wasting bandwidth etc. So adding a function to the upload applet
would still be valuable. 

> Now some technical stuff, where to store the flags (force scaling  
> yes/no, max height/width for each site- there could be more than one 
> site in one installation) for the applet, direct in the database? I 
> think i have no acces to the vfs with the opencms-functions from the 
> applet, or do I?

I would suggest using the function mentioned above to obtain the downscale
parameters for the target folder, and then use 

CmsImageScaler#toString()

To convert this to a String and pass it to the applet as an additional
parameter. In this approach, it would not make sense to allow larger images
to be uplaoded as they would be downscaled on the server later anyway.

Btw, which library are you planning to use to downscale the images with the
applet?

Kind Regards,
Alex.

-------------------
Alexander Kandzior
                                                               
Alkacon Software GmbH  - The OpenCms Experts                  
http://www.alkacon.com - http://www.opencms.org                 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of John Bieling
> Sent: Friday, September 29, 2006 9:23 PM
> To: The OpenCms mailing list
> Subject: [opencms-dev] dev of auto-img-scale-down-feature for 
> upload.jar in progress, feedback wanted...
> 
> I just looked at the source of the upload.jar and it does not 
> seem to be 
> so hard to implement the auto-scale-down of uploaded 
> images... There is 
> a function called  "addFileToZip" which is the only point 
> that needs to 
> be changed. If the file that is to be added is an img, scale 
> it before 
> adding it.
> 
> But I am not so sure about the "look & feel", here are my 
> sugestion, any 
> feedback would be helpfull.
> 
> First, I want the admin of the page to preset some max height and max 
> width, maybee even allow to force that without asking during upload.
> Second, if the admin does not use that force-feature, each 
> time an img 
> is processed a new window pops up with
>  - img preview
>  - img name
>  - option to "leave as is" - "scale to preset" and "scale to custom"
>  - also a "dont ask again and process all upcoming images like this 
> one"-checkbock
> 
> My clients often have no idea how to edit their camera images, so I 
> think that at a later stage, in that window the user can also select 
> which PART of the source image is to be uploaded.
> 
> Now some technical stuff, where to store the flags (force scaling  
> yes/no, max height/width for each site- there could be more than one 
> site in one installation) for the applet, direct in the database? I 
> think i have no acces to the vfs with the opencms-functions from the 
> applet, or do I?
> 
> Thanks
> John B.
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list