canton7 / fuelphp-casset

Better asset management library for fuelphp (with minification!)
MIT License
103 stars 29 forks source link

Image handling functionality #11

Closed rclanan closed 12 years ago

rclanan commented 12 years ago

Would it be possible to get some image functions like thumbnail generation or image resizing (height, width, and auto) added to casset?

rclanan commented 12 years ago

Ah, and watermarking!

rclanan commented 12 years ago

This might already been done.. Just found there is an image class in fuel..looking at how it would work with casset now.. http://fuelphp.com/dev-docs/classes/image.html

canton7 commented 12 years ago

This isn't really something you want to be doing at the asset management level. If these are images being uploaded to your site, you probably want to be processing them, resizing them, etc, as they're uploaded.

Doing this post-upload (that is, when the image is needed) is probably possible, but the type of processing needed is going to be very user-specific and therefore hard to generalise into a library (other than provide some generic tools, for which there are already plenty of libraries). To be honest, though, it's so far removed from what Casset currently does that writing a whole new library would make the most sense.

If you're wanting watermarking, it sounds like you're doing some sort of photographic gallery? I did one such gallery for a photography recently, and found the best approach was to write an application for the client's computer, which resized, watermarked, compressed, etc, the images, then uploaded them straight to Amazon's S3 service. That way, we avoided massive images being uploaded (which would only have been resized down, and would therefore have been merely a waste of bandwidth), and moved the storage away from the website hosting service, which lowered costs somewhat. The client then communicated its actions to the website, which updated its record of what images were available.

Hope this all makes sense, Antony