Is it possible to save a cropped image via image manipulation class? |
[eluser]winterain[/eluser]
Hi guys, long time no see.. I'm working on a new CMS site, which features uploading of images for a catalog. So far things have been working great, and I've even gotten the upload image, and create thumbnail automatically to work. However I have a peeve now, and that is, I really would like to be able to create a thumbnail via cropping instead of resizing.... Simply because I need my thumbnails to all be 150x100 , without using any stretched resizing.. so I wanted to set it so that if an image is smaller than 600x400 , I would choose to crop 150x100 out of it to create the thumbnail. But unfortunately, it seems to me that the creating and saving thumbnail feature is only available to resizing.. is there any workaround towards this ? Or maybe I am understanding the image manipulation class wrong... Any help would be greatly appreciated! Thanks in advance!
[eluser]Twisted1919[/eluser]
Even if the Image manipulation class is pretty good , not good enough though . i am using phpThumb when i need to resize the images in a way that they don't get distorted . Take a look here http://phpthumb.gxdlabs.com/ . It has adaptive resize which makes all the calculations for you and get's a very very good and clear image . I am using it since several months ago and i had no problem with it whatsoever . I only use codeigniter image class to apply the watermarks and that's all .
[eluser]winterain[/eluser]
phpthumb was nice but really huge! I'm using timthumb for displaying... I'm not sure if I'm ready to mix phpthumb in CI to do what I need ..
[eluser]winterain[/eluser]
this is killing me... every example I've found on google has the config['new-path'] set when using crop() , but for me, the new file just gets written without any cropping! I've tried resize and rotate and they all work, just not crop() .........
[eluser]winterain[/eluser]
This is the code in question: Code: function create_thumb($file,$info) { everything works, files are copied correctly, just that the new file is exactly the same as the source file...
[eluser]winterain[/eluser]
bah code won't show up for some reason beyond me, it works now.. haha... |
Welcome Guest, Not a member yet? Register Sign In |