You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henrik Vendelbo <hv...@bluprints.com> on 2005/03/15 23:44:25 UTC

Scale and rotate images

I am curious. What formats did you manage to manipulate on the server side ?
Did you use AWT to do it ?

I need to manipulate(crop mainly) gif jpeg png & wbmp, but currently plan to do it outside java as I don't quite trust it to be reliably implemented in Java. Am I mistaken ?

Henrik

----- Original Message ----- 
From: "Barry Books" <bf...@mac.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, March 14, 2005 2:10 PM
Subject: Re: AW: AW: Secure Files


> >I suppose with "key" you mean a unique image identifier (aka primary key), 
> >not something with encryption. 
> Yes I meant database key. I also just named the file from the key so the filename
> for and image with a primary key of 1234 would be 1234.jpg
> 
> >It would be best if I could avoid requests to the database server from the 
> >image server, so there is only one request to the database for the 
> >construction of the tapestry page. 
> If your images never change then you would not need to hit the database to
> determine the last modified time. My images could change.
> 
> >Problem with this is security - even with random filenames it would be 
> >possible to post them somewhere and send the links around to users without 
> >permission. In my last reply I explained how this could be avoided using an 
> >encrypted string for the key that contains the primary key of the image and 
> >an additional timestamp. 
> 
> If the images are served from the cache thru a service you can apply any securtiy
> you like. The images would not be directly accessible.
> 
> >Regarding image storage: 
> 
> >Using coda the local caching is done automatically, and depending on 
> >configuration the file is either received from a central repository and 
> >cached if a user requests it or it is distributed to all servers on file 
> >upload (so every server always has an up-to-date copy on his hard drive). 
> >The synchronization happens transparently at disk IO level, so I don't have 
> >to care about it in my application. If a server goes down and misses some 
> >file uploads, it will receive them transparently from other servers after 
> >the images are requested. 
> 
> Perhaps coda could do this but I had over 500gig of images but only 40gig drives
> on the webserver. The method above allows this to happen transparently.
> 
> I also built some smarts into my image webservice. It could scale and rotate images
> and since I had my images in the database I had multiple ones load balanced.
> 
> Barry
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Scale and rotate images

Posted by Barry Books <bf...@mac.com>.
The code evolved over the years but ended up using the 1.4 image routines that don't require X.

We had reliability problems with every method we tried. What finally worked was creating the
webservice that ran in its own tomcat. We the load balanced them and added some external code to
restart them when they quit.


>	I am curious. What formats did you manage to manipulate on the server side ?
>Did you use AWT to do it ?

>I need to manipulate(crop mainly) gif jpeg png & wbmp, but currently plan to do it outside java as I >don't quite trust it to be reliably implemented in Java. Am I mistaken ? 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Scale and rotate images

Posted by Gabe <gh...@ekosystems.com>.
I've done that using JAI (Java advanced imaging). I did some scaling 
and rotating of images about a year ago and the results were good. (I 
think it tries to use native stuff if its available for the platform). 
Not sure if java 1.5 has this integrated in or if its still a separate 
package.

-gabe

On Mar 15, 2005, at 5:44 PM, Henrik Vendelbo wrote:

> I am curious. What formats did you manage to manipulate on the server 
> side ?
> Did you use AWT to do it ?
>
> I need to manipulate(crop mainly) gif jpeg png & wbmp, but currently 
> plan to do it outside java as I don't quite trust it to be reliably 
> implemented in Java. Am I mistaken ?
>
> Henrik
>
> ----- Original Message -----
> From: "Barry Books" <bf...@mac.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Monday, March 14, 2005 2:10 PM
> Subject: Re: AW: AW: Secure Files
>
>
>>> I suppose with "key" you mean a unique image identifier (aka primary 
>>> key),
>>> not something with encryption.
>> Yes I meant database key. I also just named the file from the key so 
>> the filename
>> for and image with a primary key of 1234 would be 1234.jpg
>>
>>> It would be best if I could avoid requests to the database server 
>>> from the
>>> image server, so there is only one request to the database for the
>>> construction of the tapestry page.
>> If your images never change then you would not need to hit the 
>> database to
>> determine the last modified time. My images could change.
>>
>>> Problem with this is security - even with random filenames it would 
>>> be
>>> possible to post them somewhere and send the links around to users 
>>> without
>>> permission. In my last reply I explained how this could be avoided 
>>> using an
>>> encrypted string for the key that contains the primary key of the 
>>> image and
>>> an additional timestamp.
>>
>> If the images are served from the cache thru a service you can apply 
>> any securtiy
>> you like. The images would not be directly accessible.
>>
>>> Regarding image storage:
>>
>>> Using coda the local caching is done automatically, and depending on
>>> configuration the file is either received from a central repository 
>>> and
>>> cached if a user requests it or it is distributed to all servers on 
>>> file
>>> upload (so every server always has an up-to-date copy on his hard 
>>> drive).
>>> The synchronization happens transparently at disk IO level, so I 
>>> don't have
>>> to care about it in my application. If a server goes down and misses 
>>> some
>>> file uploads, it will receive them transparently from other servers 
>>> after
>>> the images are requested.
>>
>> Perhaps coda could do this but I had over 500gig of images but only 
>> 40gig drives
>> on the webserver. The method above allows this to happen 
>> transparently.
>>
>> I also built some smarts into my image webservice. It could scale and 
>> rotate images
>> and since I had my images in the database I had multiple ones load 
>> balanced.
>>
>> Barry
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org