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

Claus Priisholm cpr at codedroids.com
Mon Oct 9 22:54:26 CEST 2006


I've attached a JSP which I've used to generate thumbs for a photoalbum. 
The JSP is actually for OpenCms 5 but the thumbnailFromImage() method 
should be plain j2se.

regards
Claus

John Bieling wrote:
> Hi Claus Priisholm,
> 
> that sourcecode would be helpfull, so I do not need to invent everything 
> again. :-)
> 
> John Bieling
> 
> 
> 
> 
> Claus Priisholm schrieb:
>> I haven't checked what the OC 6 build-in image scaling does, but it is 
>> fairly simple to do basic scaling with the 2D graphics API - I have an 
>> example somewhere I could dig out if your interested (used it for 
>> generating thumbnails in OC 5).
>>
>> regards
>> Claus
>>
>> John Bieling wrote:
>>> Hi Alexander,
>>>
>>> great idea, I will do it with the size-parameter beeing passed to the 
>>> applet, I will read it from the folder the user is currently at (with 
>>> upward-"search" if the current folder does not has it set). That way 
>>> I do not need to prompt for anything during upload and the admin/user 
>>> can set it as desired. Great.
>>>
>>> But i did not start thinking about "how to do the scaling" - so I 
>>> cannot tell you which lib I am going to use, will figure that out 
>>> next week - But is there a problem? Can I not just use the same one 
>>> opencms is using? But I will read me into that subject this week, so 
>>> - you may help, but I will also teach myself about just that this 
>>> week....
>>>
>>> Cu
>>> John
>>>
>>>
>>>
>>> Alexander Kandzior schrieb:
>>>> 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
>>>>>
>>>>>
>>>>>     
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>   
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
> 
> 
> _______________________________________________
> 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
> 

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PhotoAlbum.jsp
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061009/f86c3fa4/attachment.ksh>


More information about the opencms-dev mailing list