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

Caching icons for pdf sitecore items results in caching icon as pdf file #96

Closed
lampinge3 opened this issue Jul 29, 2021 · 2 comments
Closed

Comments

@lampinge3
Copy link

Version of Dianoga

5.4.0
Can also be replicated in 5.2.0 and 5.3.0

Environment description

Sitecore 9.3

What configs you have enabled

Dianoga.Jpeg.config
Dianoga.Jpeg.Lossy.config
Dianoga.Png.config
Dianoga.Strategy.MediaCacheAsync.config
Dianoga.WebP.config

Reproducible steps (1... 2... 3...) that cause the issue

  1. Clear the MediaCache
  2. Navigate to the sitecore media library, bring up any pdf file and note the pdf icon under the "Media" section
  3. Inspect element on the icon, then scroll up to the iframe holding the image (about 2 levels up). Then right click on the iframe src and "open in new tab."
  4. Return to the media library, and view another item.
  5. Click on the same pdf file you viewed in step 2, then scroll down to the media section.

What you expected to see, versus what you actually saw

Expect to see the same pdf logo under media library. Instead, once that logo gets cached by Dianoga, the media section displays an html webpage with error "Failed to load pdf document."
image

Relevant logs

There was nothing related to the issue the logs.

Other notes

We are using a custom template for pdfs but this seems unrelated. Our "initials_pdf" template inherits /sitecore/templates/System/Media/Unversioned/Pdf.

@twellstx
Copy link

We are having the same issue. The optimization process is changing the icon from a png to a pdf which causes an auto download of the corrupt pdf document every time you interact with the media in the media library.

@markgibbons25
Copy link
Collaborator

Thanks for the great repro steps. Fixed in 5.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants