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

Image preview shows default pimcore placeholder because "aspectratio" parameter is ignored #6057

Open
alexej-d opened this issue Mar 18, 2020 · 4 comments
Assignees
Labels
Bug

Comments

@alexej-d
Copy link

@alexej-d alexej-d commented Mar 18, 2020

Bug Report

Expected behavior

Using this twig code an image preview should be visible in backend: {{ pimcore_image('visual', {class: 'mx-auto w-full', thumbnail: {aspectratio: true, width: 476}}) }}

Actual behavior

Only pimcore's placeholder is showing.

Steps to reproduce

Use the top code in a document template and upload an image to the field in editmode. After attaching the image to the field, a broken preview is being shown. Addind a height parameter to the image fixes this behaviour but unsets the possibility to scale an image by width.
The problem is that the image editable generates following url /admin/asset/get-image-thumbnail?id=5&width=476&height=0&id=5&path=%2Fvisuals%2Fvisual_home_1.png&alt=&cropPercent=&cropWidth=&cropHeight=&cropTop=&cropLeft=&predefinedDataTemplates=. When &aspectratio=1 is appended to the url all works well so I assume the JavaScript code is ignoring aspectratio right now which is a bug.

@brusch brusch added the Bug label Mar 24, 2020
@brusch brusch added this to To do in #81 | 16/03/2020 - 27/03/2020 via automation Mar 24, 2020
@dvesh3

This comment has been minimized.

Copy link
Contributor

@dvesh3 dvesh3 commented Mar 24, 2020

@alexej-d Sorry, cannot reproduce with given code snippet. Could you please provide clear steps? thanks!

@alexej-d

This comment has been minimized.

Copy link
Author

@alexej-d alexej-d commented Mar 24, 2020

@dvesh3 can you try in dev mode with debugging on? I always see the image filetype-not-supported.svg of the AdminBundle. Once you change line 357 in vendor/pimcore/pimcore/bundles/AdminBundle/Resources/public/js/pimcore/document/tags/image.js to something like this + Ext.urlEncode(this.datax) + (this.options.thumbnail.aspectratio ? '&aspectratio=1' : ''); the correct thumbnail is being shown in the editmode.

@dvesh3

This comment has been minimized.

Copy link
Contributor

@dvesh3 dvesh3 commented Mar 25, 2020

@alexej-d please share affected Pimcore version. Thanks!

@alexej-d

This comment has been minimized.

Copy link
Author

@alexej-d alexej-d commented Mar 25, 2020

@dvesh3 it's 6.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.