Media Library / Glide only loading JPEGs
Hey there,
So I had a Laravel/Twill app running successfully on a subdomain with no issue.
Today I needed to move it to the main domain to go live. This is a CPanel shared host server btw.
So I moved everything over to a root folder named
laravel-core
and then the public folder, sitting separately as public_html
After configuring everything to address the new paths, the site loads, but not the images coming from the Twill CMS. Well, not all of them.
On looking at the Media Library in the CMS,
What was working previously on the sub-domain, is that it seems that only image files as a JPEG
were being successfully loaded via Glide/Twill in the /img/
route. As you can see in the screenshot, the Media Library, with the network requests to the right. Images as jpeg
are successfully coming through Glide, successfully being manipulated, but only JPEGs
.
JPEG Example:
https://shiftit.no/img/c8a9d6bf-0a49-4e16-9618-a42a250f02ef/6346c314aa282csswj.jpeg?fm=webp&q=60&auto=compress%2Cformat&fit=min&dpr=1&h=256
JPG Example: 404 error
https://shiftit.no/img/60dabc39-b70d-432b-a7ee-43af0aaa966f/shiftit-home-feature-mix21.jpg?fm=webp&q=60&auto=compress%2Cformat&fit=min&dpr=1&h=256
I am absolutely baffled, I double checked I wasn't doing any extension filtering in the Glide/Twill settings, everything is pretty much default, out of the box settings.
I've delete the Glide Cache etc, I am at a loss.
Any help would be greatly appreciated !37 Replies
Hello, have you done the symlink to the storage path on the new server ?
php artisan storage:link
I had to do it manually because the the command would not work, unsure if it was because of absolutele paths or whatnot
Does it work if you upload a new jpg file ?
No, the image doesn't load in the ML, but it uploads to the server
I can access it via the storage url directly, but not through the Glide
img
Ok that must be a symlink problem, are you sure the symlink is good ?
Alos, be sure to clean all the caches :
php artisan optimize && php artisan route:clear && php artisan config:clear
The symlink is working for everything else in the storage
Also for
JPEG
files via /img/
Just not for other extensions, which is super weird
Yes, I've done all the cache dumpsCheck also the glide config in your .env file
You can also define this:
MEDIA_LIBRARY_LOCAL_PATH=uploads/
Maybe check this thread : https://github.com/area17/twill/issues/19
GitHub
[Media Library] Filesystem Config not used - Invalid image url · Is...
Hi, i have currently the challenge, that the returned url values for images which has been uploaded locally. I configured the twill app as following: //.env APP_URL=twill.local ADMIN_APP_URL=twill....
The
/uploads
path is on by default, and working correctly for the system path as far as I can tell.
It is so bizarre, I can see in your link there, allowed_extensions
, but I don't have that specifically set anywhere. I mean, the Media Library allows me to upload other formats.there's no coupling between the formats you allow to upload and what glide can render
the jpg/jpeg issue is really weird indeed
I am absolutely baffled.
Does the Artisan storage link command do anything outside of running a symlink creation loop based on what is in the
links
array from the filesystems config?
Does Twill/Glide run anything additionally here?nope, and the storage link is actually not needed for glide to work
since it goes through a controller on the /img path
what I suspect is the version of GD or Imagick in use by your cpanel host
depending on how it's been compiled it could have this issue I guess
It worked perfectly well on a subdomain on the same host. Bog standard Cpanel shared server.
Had the app on a subdomain for months during reviewed development, moved it 'live' so to speak, and this issue arises.
very strange
did you ask your hosting provider?
Not yet, wanted to see if it was something that was seen before through here.
I guess I could ask them to trace the process or whatever, but I'm unsure how much help they could shine on this.
is the derived image generated on the filesystem by glide?
As in, is it physically uploaded?
If I use the
jpg
example from the start of the thread, and change /img/
to /storage/uploads/
https://shiftit.no/storage/uploads/60dabc39-b70d-432b-a7ee-43af0aaa966f/shiftit-home-feature-mix21.jpg?fm=webp&q=60&auto=compress%2Cformat&fit=min&dpr=1&h=256I mean when you request it with /img do you see a new file under the glide_cache folder?
No, it isn't there
Just the
JPEGs
did you try dd'ing your way into the glide controller?
I have not went as far as that, but may give that a look tomorrow. Would this be the controller
A17\Twill\Services\MediaLibrary\Glide
?yes, but you'll need to drilldown into glide itself from there
GitHub
twill/GlideController.php at 861032e3c94965c59cc5c5d2ef2f1014b6e201...
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
GitHub
twill/Glide.php at 7c030c6d315e679b51ee4de9537816e3a0f9abb1 · area1...
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
GitHub
glide/Server.php at 0305fff66b2c427d41e8558385d235ce10230d85 · barr...
Wonderfully easy on-demand image manipulation library with an HTTP based API. - glide/Server.php at 0305fff66b2c427d41e8558385d235ce10230d85 · barryvdh/glide
For reference, dd'ing the $path in the Glide controller,
Prints out a path for
JPEG
, anything else still presents a 404Made a small test with a
jpg
url to test the route matching,It is matching the correct route in the test with a
jpg
But for whatever reason, it won't do this with the actual url