-
Notifications
You must be signed in to change notification settings - Fork 572
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
feat(media-library): add option to return original media file #985
Conversation
Hi @Keimeno, That's cool! I've also used a (hacky) homegrown helper to get the actual raw image when working with GIFs :
I see the value of having a more robust solution in Twill core. Also very curious to know what others have been doing for this :) |
To make things more robust, I've added support for Azure & S3 as well.
|
@Keimeno Thanks for taking the time to refine this!
Do you think that this feature could live in its own helper method? Something in the spirit of |
I'm unsure if Besides, after further consideration regarding \A17\Twill\Services\MediaLibrary\ImageService::getRawUrl($block->imageObject('role')->uuid) And since the $block->image('role') |
Hey @Keimeno, thanks for the feedback! I see that From my perspective (ie. my use case), I think the main issue remains that I'm still unsure about changing the behavior of |
Thanks a million for the input @pboi20! |
Thanks, @ifox, for the feedback on the PR, the requested changes have been made. Also found a small bug in my code, should have returned |
Description
Currently, when using Glide as Media Library Image Service, I am unable to display uploaded SVGs, since Glide does not support SVGs.
There is a workaround to this problem, you can set the environment variable
GLIDE_DRIVER
toimagick
. This “solves” the problem, meaning the SVG will be converted into a JPEG and thus losing image quality and transparency.The workaround, however, is not perfect, and I'd prefer getting my unmodified SVG back instead. This is what this PR solves.
This may result in a breaking change, and it might make more sense to add an option in the config that allows the original SVG to be returned, such as
twill.glide.use_original_svg
with its default value being set tofalse
.Open to ideas and feedback