Codeigniter Crop |
[eluser]alexaaaaaaaaaa[/eluser]
Hi all i have this code but it's not working like i want and i know there's something easy to find and fix here's my code Code: $x = '9';
[eluser]InsiteFX[/eluser]
For an image to look correct you need to keep the image aspct ratio! 512x512 256x256 128x128 64x64 32x32 16x16 8x8 4x4 2x2 Code: height = 183 / 2; If you change just one axis your image will never look correct!
[eluser]alexaaaaaaaaaa[/eluser]
[quote author="InsiteFX" date="1336750744"]For an image to look correct you need to keep the image aspct ratio! 512x512 256x256 128x128 64x64 32x32 16x16 8x8 4x4 2x2 Code: height = 183 / 2; If you change just one axis your image will never look correct! [/quote] ok so why we split the height and width on 2 ? i need to crop to a specific size i have the x and y coordonates and based on that i need to crop. If you want i can give you the exact site from where i took the ideea http://fbcover.3fusion.in/
[eluser]InsiteFX[/eluser]
You only need to divide by 2 4 6 8 etc to maintain the image aspect ratio. You can do it anyway you want really but you need to do both height and width.
[eluser]Mat-Moo[/eluser]
Couple of things, #1 Don't quote your numbers, they are integers so treat them as such. #2 Your height is less than 0? 183-229? don't make sense? #3 Check out my image moo library might make a bit more sense and easier to ue
[eluser]CroNiX[/eluser]
[quote author="Mat-Moo" date="1336762675"]Couple of things, #1 Don't quote your numbers, they are integers so treat them as such. #2 Your height is less than 0? 183-229? don't make sense? #3 Check out my image moo library might make a bit more sense and easier to ue[/quote] it's 183 - (-229), which is a positive number (412). Not sure why he's writing it that way though.
[eluser]alexaaaaaaaaaa[/eluser]
Maybe i didn't explain myself well I have this image ok like 1025x 400 that i upload after i upload i can move it around and then i have the x and y coords to crop, it doesn't have to be square crop it must be 697x183 and crop the image... So first we resize the pic to 697x183 and then we crop where x = 9 and y = -255 now i use this code Code: $x = '9'; http://www.picz.ro/show-image.php?id=505...aa2bc1bdb1
[eluser]Mat-Moo[/eluser]
If your only cropping, why are you calling resize? Did you look at image_moo? 3 lines of code, but it auto crops it to the center for you, so might not be any good... $this->image_moo ->load('DSC01707.JPG') ->resize_crop(697,183) ->save('thumb_ddd.jpg');
[eluser]alexaaaaaaaaaa[/eluser]
but after cropping i need to resize it right? I took a look after your code and i'll let you know . |
Welcome Guest, Not a member yet? Register Sign In |