This is a little off topic, but can anybody recommend a photo resizing utility to run after the upload? I too have a need to allow the user to upload a user photo, which could be stored in a BLOB, but I know it is not that simple. Many sites do post processing to adjust the image resolution, size or even type, and some allow the user to crop the image as well. I'm curious if anybody has experience with an open source photo manipulation framework that plays well with Struts 2.
Steve Mitchell http://www.Byteworksinc.com -----Original Message----- From: Richard Sayre [mailto:richardsa...@gmail.com] Sent: Wednesday, June 10, 2009 12:41 PM To: Struts Users Mailing List Subject: Re: Performance issue with large data(such as images) >Thanks, Rich, I''m happy to help. > If I use BLOB, I have to make a lot of change to my code. Therefore, I have > to persist it as String. I used base64 to encode and decode the byte[] into > String. Because I resize the images to small ones. I use a VARCHAR length > about 10k~20k to persist the String. Thats fine, if you don't want to do a hugh code change then keep it the same > "How often do you need to load all 300 images? If it is forum style I > would imangine a limited number of posting per page say max 20. So > the would be a maximum of 20 images per page load." > If this is true, which method is the best among the above three? Which method is 'best' depends on what you want. For fast access and low memory - persist to hard drive > "If you must use the least amount of memory as possible, persist the > images to the hard drive and store the file reference to the url in > the database. " > If I want to persist images to the hard drive of server. Shall I persist the > data inside WAR or outside? Because user can change their portrait, does it > mean it must be persisted outside WAR? No just make a base dir in your app called 'userAvatar' or something similar. Then persist the image as user_xxxx.gif (xxxx = the user id). When they chage their image override the file. Also as stated by Pawel, make sure you have a performance problem before you try to solve a performance problem. > -- > View this message in context: > http://www.nabble.com/Performance-issue-with-large-data%28such-as-images%29-tp23945029p23948048.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org ------------------------------------------------------------------------------ NOTICE: This electronic mail message and any attached files are confidential. The information is exclusively for the use of the individual or entity intended as the recipient. If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited. If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you. ============================================================================== --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org