You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Purcell <sp...@vertisinc.com> on 2005/05/05 15:06:54 UTC

Seeking advice image resizing

Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma.

I have created a ECommerce type site, in which there are three display sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a product.

My application is 100% struts, running on Tomcat 5.x. I would like to be able to upload the original, them create the preview, and thumb from the original.

Is there a simple java solution for this? I know there are things like image magic, etc, but eventually I am going to have this site hosted, and want a simple, effective solution. Or is the solution to pre-create these and upload three unique uploads. And if that is the case, can this be done with one multipart form using the commons file uploader? Or do I need a wizard type approach, where they upload original, next page, preview, etc.?

Any info would be appreciated.

Thanks,
Scott


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


Re: Seeking advice image resizing

Posted by Dakota Jack <da...@gmail.com>.
On a final note, if you are thinking of a commercial solution, be
aware that there are numerous fine solutions coming onto the
marketplace, including stuff from google and hotmail.  The google wars
are spreading.  The whole thing should be interesting as h_ll to
watach.

On 5/5/05, Scott Purcell <sp...@vertisinc.com> wrote:
> Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma.
> 
> I have created a ECommerce type site, in which there are three display sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a product.
> 
> My application is 100% struts, running on Tomcat 5.x. I would like to be able to upload the original, them create the preview, and thumb from the original.
> 
> Is there a simple java solution for this? I know there are things like image magic, etc, but eventually I am going to have this site hosted, and want a simple, effective solution. Or is the solution to pre-create these and upload three unique uploads. And if that is the case, can this be done with one multipart form using the commons file uploader? Or do I need a wizard type approach, where they upload original, next page, preview, etc.?
> 
> Any info would be appreciated.
> 
> Thanks,
> Scott
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Seeking advice image resizing

Posted by Dakota Jack <da...@gmail.com>.
What, by the way, is the URL for your site?

On 5/5/05, Scott Purcell <sp...@vertisinc.com> wrote:
> Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma.
> 
> I have created a ECommerce type site, in which there are three display sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a product.
> 
> My application is 100% struts, running on Tomcat 5.x. I would like to be able to upload the original, them create the preview, and thumb from the original.
> 
> Is there a simple java solution for this? I know there are things like image magic, etc, but eventually I am going to have this site hosted, and want a simple, effective solution. Or is the solution to pre-create these and upload three unique uploads. And if that is the case, can this be done with one multipart form using the commons file uploader? Or do I need a wizard type approach, where they upload original, next page, preview, etc.?
> 
> Any info would be appreciated.
> 
> Thanks,
> Scott
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Seeking advice image resizing

Posted by Dakota Jack <da...@gmail.com>.
There is a lot to know in this area.  ImageIO is good and the AWT is
okay.  JAI is the up to date Java standard.  Unless you just want to
grab someone else's code, which is okay, you have a lot of learning to
do.  There are numerous good books and tutorials around.

I have built classes to resize, crop, border, add text, grayscale,
convolve, overlay, swtich between types (gif, jpeg, etc), etc.  A lot
of what I have done began with studying the contents of Abey
Mullassery's image tags in the commons taglib library.  I suggest you
start there.  He has a Poor Mans Imaging Wrapper which, contary to the
nomative adjective rule on hyphens, is called the "Poor Man's Imaging
Wrapper" or PMIW.  Look at that for cool solutions for AWT, Java2D and
JAI.  He is also very helpful and I hope to add to his code out of
gratefulness soon.  (He is also very busy, so be advised on that.)

Applications are what I build for a living, so this is not presently
available for free use.  However, this application will soon be on the
web for the free use of anyone and everyone.  So, if you are thinking
of a commercial product be aware that.



On 5/5/05, Scott Purcell <sp...@vertisinc.com> wrote:
> Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma.
> 
> I have created a ECommerce type site, in which there are three display sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a product.
> 
> My application is 100% struts, running on Tomcat 5.x. I would like to be able to upload the original, them create the preview, and thumb from the original.
> 
> Is there a simple java solution for this? I know there are things like image magic, etc, but eventually I am going to have this site hosted, and want a simple, effective solution. Or is the solution to pre-create these and upload three unique uploads. And if that is the case, can this be done with one multipart form using the commons file uploader? Or do I need a wizard type approach, where they upload original, next page, preview, etc.?
> 
> Any info would be appreciated.
> 
> Thanks,
> Scott
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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


Re: Seeking advice image resizing

Posted by Martin Gainty <mg...@hotmail.com>.
Scott/Erik-

This sounds like a fun project
If you are looking for an example I would try
http://java.sun.com/products/jfc/tsc/articles/javaOne2001/600/
(Please keep us informed on how you are progressing)

Martin-
617-852-7822

----- Original Message ----- 
From: "Erik Weber" <er...@mindspring.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, May 05, 2005 1:47 PM
Subject: Re: Seeking advice image resizing


> Look at ImageIO for read/write and RescaleOp for your scaling.
>
> Erik
>
>
> Scott Purcell wrote:
>
>>Not truly struts related, but I would assume that people on this list know 
>>a solution, or workaround for what appears to be a common dilemma.
>>
>>I have created a ECommerce type site, in which there are three display 
>>sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view 
>>for a product.
>>
>>My application is 100% struts, running on Tomcat 5.x. I would like to be 
>>able to upload the original, them create the preview, and thumb from the 
>>original.
>>
>>Is there a simple java solution for this? I know there are things like 
>>image magic, etc, but eventually I am going to have this site hosted, and 
>>want a simple, effective solution. Or is the solution to pre-create these 
>>and upload three unique uploads. And if that is the case, can this be done 
>>with one multipart form using the commons file uploader? Or do I need a 
>>wizard type approach, where they upload original, next page, preview, 
>>etc.?
>>
>>Any info would be appreciated.
>>
>>Thanks,
>>Scott
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 

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


Re: Seeking advice image resizing

Posted by Erik Weber <er...@mindspring.com>.
Look at ImageIO for read/write and RescaleOp for your scaling.

Erik


Scott Purcell wrote:

>Not truly struts related, but I would assume that people on this list know a solution, or workaround for what appears to be a common dilemma.
>
>I have created a ECommerce type site, in which there are three display sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a product.
>
>My application is 100% struts, running on Tomcat 5.x. I would like to be able to upload the original, them create the preview, and thumb from the original.
>
>Is there a simple java solution for this? I know there are things like image magic, etc, but eventually I am going to have this site hosted, and want a simple, effective solution. Or is the solution to pre-create these and upload three unique uploads. And if that is the case, can this be done with one multipart form using the commons file uploader? Or do I need a wizard type approach, where they upload original, next page, preview, etc.?
>
>Any info would be appreciated.
>
>Thanks,
>Scott
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

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


RE: Seeking advice image resizing

Posted by draegoon Z <dr...@hotmail.com>.
I solved this problem with a mysql db blob field and a servlet
with params to dynamically resize the image.

The code can be found at http://www.draegoonz.com/downloads.do

I haven't done anything with the site in a while, so let me know if you have 
problems.



>From: "Scott Purcell" <sp...@vertisinc.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: <us...@struts.apache.org>
>Subject: Seeking advice image resizing
>Date: Thu, 5 May 2005 08:06:54 -0500
>
>Not truly struts related, but I would assume that people on this list know 
>a solution, or workaround for what appears to be a common dilemma.
>
>I have created a ECommerce type site, in which there are three display 
>sized images. A 125x125 thumb, a 256x256 preview, and a 100% original view 
>for a product.
>
>My application is 100% struts, running on Tomcat 5.x. I would like to be 
>able to upload the original, them create the preview, and thumb from the 
>original.
>
>Is there a simple java solution for this? I know there are things like 
>image magic, etc, but eventually I am going to have this site hosted, and 
>want a simple, effective solution. Or is the solution to pre-create these 
>and upload three unique uploads. And if that is the case, can this be done 
>with one multipart form using the commons file uploader? Or do I need a 
>wizard type approach, where they upload original, next page, preview, etc.?
>
>Any info would be appreciated.
>
>Thanks,
>Scott
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>



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


Re: Seeking advice image resizing

Posted by Shey Rab Pawo <pa...@gmail.com>.
I am not sure why Leon says that running headless mode is "not that
easy".  He must have experiences I have not had.  My experience is
that running in headless mode is a fairly simple matter.  All you have
to do is set the headless parameter and there you are.  As I said,
maybe Leon has something else in mind.



On 5/5/05, Leon Rosenberg <st...@anotheria.net> wrote:
> What about jmagick?
> 
> http://www.yeo.id.au/jmagick/
> 
> The problem with using awt is that you need an X installation on your
> server, which you normally haven't. And running
> AWT in headless mode is not that easy. Beside this, jmagick provide better
> quality of image resizement as awt.
> 
> Regards
> Leon
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Mark Benussi [mailto:mark_benussi@hotmail.com]
> > Gesendet: Donnerstag, 5. Mai 2005 15:29
> > An: 'Struts Users Mailing List'
> > Betreff: RE: Seeking advice image resizing
> >
> > :) Me too. Its on my list of things to do but from some
> > research I did last week I found this gem
> >
> > http://developers.sun.com/solaris/tech_topics/java/articles/awt.html
> >
> > -----Original Message-----
> > From: Scott Purcell [mailto:spurcell@vertisinc.com]
> > Sent: 05 May 2005 14:07
> > To: user@struts.apache.org
> > Subject: Seeking advice image resizing
> >
> > Not truly struts related, but I would assume that people on
> > this list know a solution, or workaround for what appears to
> > be a common dilemma.
> >
> > I have created a ECommerce type site, in which there are
> > three display sized images. A 125x125 thumb, a 256x256
> > preview, and a 100% original view for a product.
> >
> > My application is 100% struts, running on Tomcat 5.x. I would
> > like to be able to upload the original, them create the
> > preview, and thumb from the original.
> >
> > Is there a simple java solution for this? I know there are
> > things like image magic, etc, but eventually I am going to
> > have this site hosted, and want a simple, effective solution.
> > Or is the solution to pre-create these and upload three
> > unique uploads. And if that is the case, can this be done
> > with one multipart form using the commons file uploader? Or
> > do I need a wizard type approach, where they upload original,
> > next page, preview, etc.?
> >
> > Any info would be appreciated.
> >
> > Thanks,
> > Scott
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
No one ever went blind looking at the bright side of life.

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


Re: Seeking advice image resizing

Posted by Leon Rosenberg <st...@anotheria.net>.
What about jmagick? 

http://www.yeo.id.au/jmagick/

The problem with using awt is that you need an X installation on your
server, which you normally haven't. And running
AWT in headless mode is not that easy. Beside this, jmagick provide better
quality of image resizement as awt.

Regards
Leon

> -----Ursprüngliche Nachricht-----
> Von: Mark Benussi [mailto:mark_benussi@hotmail.com] 
> Gesendet: Donnerstag, 5. Mai 2005 15:29
> An: 'Struts Users Mailing List'
> Betreff: RE: Seeking advice image resizing
> 
> :) Me too. Its on my list of things to do but from some 
> research I did last week I found this gem
> 
> http://developers.sun.com/solaris/tech_topics/java/articles/awt.html
> 
> -----Original Message-----
> From: Scott Purcell [mailto:spurcell@vertisinc.com]
> Sent: 05 May 2005 14:07
> To: user@struts.apache.org
> Subject: Seeking advice image resizing
> 
> Not truly struts related, but I would assume that people on 
> this list know a solution, or workaround for what appears to 
> be a common dilemma.
> 
> I have created a ECommerce type site, in which there are 
> three display sized images. A 125x125 thumb, a 256x256 
> preview, and a 100% original view for a product.
> 
> My application is 100% struts, running on Tomcat 5.x. I would 
> like to be able to upload the original, them create the 
> preview, and thumb from the original.
> 
> Is there a simple java solution for this? I know there are 
> things like image magic, etc, but eventually I am going to 
> have this site hosted, and want a simple, effective solution. 
> Or is the solution to pre-create these and upload three 
> unique uploads. And if that is the case, can this be done 
> with one multipart form using the commons file uploader? Or 
> do I need a wizard type approach, where they upload original, 
> next page, preview, etc.?
> 
> Any info would be appreciated.
> 
> Thanks,
> Scott
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



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


RE: Seeking advice image resizing

Posted by Mark Benussi <ma...@hotmail.com>.
:) Me too. Its on my list of things to do but from some research I did last
week I found this gem

http://developers.sun.com/solaris/tech_topics/java/articles/awt.html

-----Original Message-----
From: Scott Purcell [mailto:spurcell@vertisinc.com] 
Sent: 05 May 2005 14:07
To: user@struts.apache.org
Subject: Seeking advice image resizing

Not truly struts related, but I would assume that people on this list know a
solution, or workaround for what appears to be a common dilemma.

I have created a ECommerce type site, in which there are three display sized
images. A 125x125 thumb, a 256x256 preview, and a 100% original view for a
product.

My application is 100% struts, running on Tomcat 5.x. I would like to be
able to upload the original, them create the preview, and thumb from the
original.

Is there a simple java solution for this? I know there are things like image
magic, etc, but eventually I am going to have this site hosted, and want a
simple, effective solution. Or is the solution to pre-create these and
upload three unique uploads. And if that is the case, can this be done with
one multipart form using the commons file uploader? Or do I need a wizard
type approach, where they upload original, next page, preview, etc.?

Any info would be appreciated.

Thanks,
Scott


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


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