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

Black border added to images during processing #369

Open
univers-andrew opened this issue Apr 25, 2023 · 3 comments
Open

Black border added to images during processing #369

univers-andrew opened this issue Apr 25, 2023 · 3 comments

Comments

@univers-andrew
Copy link

Similar to this previously closed issue: #103

I'm also observing this same issue when using Spatie's 'Responsive Images' addon for Statamic, which is using Glide under the hood.

It seems like this has been an ongoing issue for sometime, but hasn't reared it's head enough to be esacalated, Saw a few different comments/threads on Statamic's different support channels like this one: https://statamic.com/forum/5378-glide-images-black-top-border. I remember having the issue myself on a previous project, but managed to find a workaround at the time.

I have confirmed the original image file(s) don't contain any border, and there aren't any transparency issues at play as the source files are jpgs. I can also confirm there is no CSS at play creating the border — it's within the generated image output.

I'm not doing anything particularly unusual. Here's the snippet I'm using with Spaties responsive images tag:

{{ responsive:image alt="{alt}" ratio=".75" glide:width="900" }}

Strangely enough, when I remove the glide:width="900" attribute (which sets a max width of variations to be generated) the border dissapears.... when I add it back the border returns! It doesn't happen on all images, so it seems like it could be a bug/issue depending on the cropping required for that specific image, but that's just speculation on my part!

This is happening with the default GD driver, haven't tried using Imagick for this site yet, but will test this down the track possibly.

Some screenshots for reference below:
Screenshot 2023-04-25 at 11 32 37 am
Screenshot 2023-04-25 at 11 59 30 am

Happy to supply further info as required. Would love to assit in squashing this bug — it's the only issue I've had with Glide to date! if you think I should raise this directly with Statamic as well do let me know

With thanks,
Andrew

@ADmad
Copy link
Collaborator

ADmad commented Apr 25, 2023

Have you checked with imagick instead of GD? If the issue occurs with both drivers then it could potentially be some rounding/casting issue when calculating dimensions for resizing. Someone will have to track it down and provide a patch to fix 🙂.

@univers-andrew
Copy link
Author

Hi @ADmad — have now checked gd vs imagick and only noticed it present on the standard gd driver.

When processing with imagick the black border/line doesn't appear...

Hope that helps!

@ADmad
Copy link
Collaborator

ADmad commented Apr 25, 2023

That means the issue is driver specific and not related to the dimensions calculation, which might be more difficult to track down / fix. Could be an issue with one of the GD functions itself.

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