-
Notifications
You must be signed in to change notification settings - Fork 627
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 transformations on multi language sites #1853
Comments
That is your issue. If you are going to be loading Craft from different directories, you can’t use a relative path. (Hence the recommendation for an absolute path.) |
Can I refer do a DOCUMENT_ROOT or something like that? I do not like the absolute path solution at all since this information is saved in the database and that makes transferring Craft from dev to prod and so on hard. thanks |
You can use a config file to override Volume settings. |
Hey Andris, thanks a lot! that saved me :-) |
Hey, I am facing the exact same problem, can you please tell me which volume settings did you change to fix the problem. |
@vasuhooda the problem was caused using relative paths and was solved by using absolute paths. |
Thanks, that solved my issue. I created an alias for assets path in the config file, and then used that to define path in the control panel |
Glad you got that sorted! |
Description
Image transformations seem to have a problem on multilanguage sites. The source path of the image is not found on the first call wenn the img url is something like
/en/cpresources/transforms/4?x=myZQ3ajZa
You will get the following exception:
HTTP 500 – Internal Server Error – yii\web\ServerErrorHttpException
No file exists at the given path.
If you manually remove the trailing
/en
and make/cpresources/transforms/4?x=myZQ3ajZa
out of it, the image is going to resize and it will be saved correctly in its asset's file system path.Additional information:
/userfiles/photos
(yes against recommendation)userfiles/photos
(yes against recommendation)Please note that the normal image usage works perfectly and also the rest of the multilanguage setup.
Steps to reproduce
<img src="{{ image.getUrl({width: min(1400,image.width), height: min(788, image.height)}) }}" />
Additional info
PHP version 7.1.6-1 ubuntu16.04.1+deb.sury.org+1
Database driver & version MySQL 5.7.18-0ubuntu0.16.04.1
Image driver & version Imagick 3.4.3, ImageMagick 6.8.9-9
Craft edition & version Craft Pro 3.0.0-beta.21
Yii version 2.0.12
Twig version 2.3.2
Guzzle version 6.2.1
Imagine version 0.7-dev
The text was updated successfully, but these errors were encountered: