Skip to content
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

Cropped image black borders #18

Closed
skerbis opened this issue May 23, 2019 · 11 comments
Closed

Cropped image black borders #18

skerbis opened this issue May 23, 2019 · 11 comments

Comments

@skerbis
Copy link

skerbis commented May 23, 2019

Is it possible to set the background color if the cropped result is outside the image?
Now it gets a black border.
I only see a definition in the resize method but not at the cropping.

@stefangabos
Copy link
Owner

You mean like if from an 100x100 image I would crop 50, 50, 150, 150?

@stefangabos
Copy link
Owner

i think the best way would be to have it transparent for images that support transparency and a user defined colour for JPEG

@skerbis
Copy link
Author

skerbis commented Jan 22, 2020

That would be nice

@skerbis
Copy link
Author

skerbis commented Jan 23, 2020

Look:
From
Bildschirmfoto 2020-01-23 um 16 21 59

I get this:
redaxo_1

@skerbis
Copy link
Author

skerbis commented Jan 23, 2020

Because it's possible to set the cropping outside the picture, I get black bars.

@stefangabos
Copy link
Owner

yes, i understand. i'll try and work on it over the weekend

@skerbis
Copy link
Author

skerbis commented Jan 23, 2020

I‘ll test it

@stefangabos
Copy link
Owner

I did a commit that should fix this issue. It will automatically use a transparent colour for transparent GIF and PNGs and black for non-transparent images. A custom colour can be also specified. I updated the documentation. Please consider this work-in-progress. Thanks!

@skerbis
Copy link
Author

skerbis commented Jan 24, 2020

Cool 👍 thx. I will test it today

@skerbis
Copy link
Author

skerbis commented Jan 24, 2020

@stefangabos tested 👍 .. thank you

@skerbis skerbis closed this as completed Jan 24, 2020
@stefangabos
Copy link
Owner

thank you for reporting and testing. i've created a release so you can now update via composer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants