bymayo / craft-pdf-transform

Transform a PDF page to an image (JPEG, PNG)
MIT License
12 stars 8 forks source link

Degraded Image quality #2

Closed JustJarethB closed 2 years ago

JustJarethB commented 5 years ago

Hi! We are using this plugin on a live site and we've had a request to look into a problem with images.

I have tracked it back to (some) of the images generated by the pdfTransform.

For example, this listing image (which looks like the pdf first page) versus the generated PDF Image The code being used is:

{% for download in entry.downloads.all() %}
    {% if download.kind == 'pdf' %}
    {% set imageUrl = craft.pdfTransform.url(download) %}
    ...
   <img src="{{ imageUrl }}" ...
{% endif %}

and we were using the default CP properties.

I don't know how to resolve this issue, can you suggest a course of action?

bymayo commented 5 years ago

@JustJarethB Have you set the Image Volume setting in the plugin? It looks like it's not generating the path correctly as there are 2 forward slashes in the URL.

Also, have you checked to see if it is infact generating the image? It might be a problem with Imagemagick not generating it, but the Asset is being created.

JustJarethB commented 5 years ago

My apologies @bymayo, the plugin settings were changed from png to jpg so the provided url is inaccurate. I will update, but also here are the images on an imgur link. Notice the red tinge across the image and pixellated white banner compared to the original. There is also a big file size difference here where the generated image is almost 10x at 529kB. https://imgur.com/a/PEmVHma

In answer to your questions, the Image Volume is indeed set to Images. The double forward slash I'm not sure of the cause. I image it's something along the lines of ..images/+/filename

bymayo commented 5 years ago

@JustJarethB I've looked in to this and I can't see it being an issue with the plugin - But more the way your ImageMagick is setup to handle the images.

You can set the Image Quality and Resolution though in the plugin config file. Have you tried this?