-
Notifications
You must be signed in to change notification settings - Fork 1
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
Image TransformSourcePath #3
Comments
Can you provide a bit more information such as your Craft CMS version, PHP version, and what Image Driver you're using. You can get this info from Utilities -> System Report -> Application Info. I'm not able to recreate the issue on Craft 3.5.14 with PHP 7.2.1. Using When I set my Base URL field to {% set transformedImageUrl = "/jitter/v1/transform&id=" ~ entry.image[0].id ~ "&w=150&ar=1:1&m=fit&fm=gif&q=10" %}
<img
src="{{ transformedImageUrl }}"
srcset="{{ craft.jitter.srcset(entry.image[0], [
{ w: 300, h: 250, },
{ w: 768, ar: "16:9", },
{ w: 1024, ar: "16:9", q: 100 },
]) }}"
loading="lazy"
width="1024"
/> |
Hi Kyle, I had further investigations. First thing was more a problem of my server configuration. If you run the system behind a .htaccess protected area, you need to make sure that the server itself can call the image source without getting 401 - permission denied ;-) Second thing what I found is that if you have a DOCUMENT_ROOT with "." your regex for the contenttype doesn't work properly. Instead of: preg_match("/(\..*)$/", $existingFile, $matches);
$contentType = ltrim($matches[0], "."); Needs to be: preg_match("/(\..{1,4})$/", $existingFile, $matches);
$contentType = ltrim($matches[0], "."); Now it works great! |
Hello Kyle,
thank you for your work on this plugin!
I only use the local file storage and I found that if I use "@webroot/files" in the public URL field, I get an error because the file can't be retrieved.
Transform.php (Row 168)
$masterImage = $asset->url;
needs to be changed to, but I'm not sure
$masterImage = $asset->getImageTransformSourcePath();
The text was updated successfully, but these errors were encountered: