-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adaptive_resize
cropping issue
#26
Comments
Have you tried the |
Yeah. That will fill entire image into white, ie. there would remain no image, just the color |
Can you create the background image using |
Also would be great if you can tell me how can I use box_crop in SimpleImage. |
Adaptive resize should be all you need:
Let me know if the fill/overlay solution works. |
Screendump http://i.imgur.com/CwKoE2B.png |
Actually, just use $img = new SimpleImage();
$img->create(100, 100, '#0088cc')->overlay('overlay.png')->save('result.png'); I just tested this using For adaptive resize, it will resize the image as close as possible and then trim (crop) the edges. I'm not sure why your image obtained a black background...just tried with a similar PNG and it resized it with transparency: $img = new SimpleImage();
$img->load('firefox.png')->adaptive_resize(50, 50)->save('result.png'); Closing this since the original issue is resolved. |
Ok. You can close.
:) |
For #1, look at the example again. It's creating a filled image from scratch, then overlaying
Results in this image:
I'm using many methods on files that are uploaded—they are in a temp directory so you should be able to read/write to them. Maybe talk to your host about why you can't read/write to the system temp directory, or try using For #2, using the same code and your image: $img = new SimpleImage();
$img->load('firefox.png')->adaptive_resize(50, 50)->save('result.png'); Here is the resulting image: |
#1 is okay. my bad. I was passing the simple's $img object ;) How it should be -> http://i.imgur.com/IWHBSbP.png And thanks for the help on #1 :) |
#2 though it can be solved by, again, using a pseudo image and overlapping it with actual image using best_fit. |
I'll have to take a closer look at I don't have time today, but hopefully by this weekend I'll be able to address this. You should be able to find Ultimately, we need to document exactly what behavior Reopening under a different title. |
#Appreciate. #Logic |
It turns out
However, I'm wondering what use cases exist for this behavior. It seems to me that the resulting image should be scaled to fit inside the new dimensions (like you suggest) instead of being cropped. @nazar-pc - do you have any thoughts about why |
|
Makes sense...unfortunately that introduces an API change and would mean we'd have to bump to 3.0. Instead, let's deprecate I think I'll post an update shortly. |
Didn't get time to add the new |
Cool. sounds great to add Yeah I saw changes for the |
No description provided.
The text was updated successfully, but these errors were encountered: