Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-22-2008, 06:28 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default Working with images

I have a bunch of event listings with an automatically resized image attributed to each listing. I am not sure how to go about saving and resizing these images and I am looking for advice. I will use the GD image library or ImageMagick.

There are the two ways I can think of going about it:

Option 1
The client creates a new event and the original image is uploaded to the /originals directory. A thumbnail is then immediately created in the /thumbnails directory.

Option 2
The client creates a new event and the original image is uploaded to the /originals directory. Every time an image is loaded, it is done dynamically using a controller called imageloaderController. This controller would resize the image from the original and keep a cache of resized images.


Has anyone worked with the GD image functions? What do you recommend?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-23-2008, 05:28 PM
Ewok's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Colorado SPrings
Posts: 16
Send a message via MSN to Ewok Send a message via Yahoo to Ewok
Default

As a basic rule, I like to take as much of a processing hit as I can when setting things up rather then when viewing. You will only upload an image once, but view it many times.

Just my 2c.
__________________
Give all victory and gain to others
Take all defeat and loss upon yourself
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-24-2008, 04:24 AM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

I prefer Imagick for resizing, making thumbnails or merging existing images. GD I use to create images dynamically like graphs and charts. As for you original question, consider the lifetime of the images. Will they remain viewable for extended amounts of time? If so I'd go ahead an generate thumbnails with Imagick and store them. If not, then go ahead an generate on the fly without saving a copy so you don't end up with a ton of unused image files cluttering up your server.


For example, on an intranet site you might have this weeks funniest picture where people can post snaps from their phone to catch funny office moments. Changes frequently, you might only want to save the top 20. Store thumbs of the top 20, generate the rest on the fly.

Another thing to consider is processing, if your server is a beast and it takes under .2 seconds to generate a thumb from say a 3mb image your not really loosing anything for the processing. But if it takes 1.1 seconds for the same task, your impacting usability at a noticeable level, you should either cache or generate permanent thumbs.

Another 2c...
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-24-2008, 07:22 AM
Junior Member
 
Join Date: Apr 2008
Posts: 5
Default

Quote:
Originally Posted by Elemental
I prefer Imagick for resizing, making thumbnails or merging existing images. GD I use to create images dynamically like graphs and charts.
Could you say a bit more please

Last edited by Elemental : 04-24-2008 at 02:06 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2008, 02:06 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

Basically if I already have the image I use Imagick to manipulate it. If I don't have an image, I use GD to create one.


* I accidentally edited your post, sorry
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:15 PM.