wrong custom size with png file

vincent3569 Member, Translator
edited February 2019 in General support

hi

I have something going wrong with png files.

when I try to insert a custom sized image with tinyZenpage of a png image, I have a wrong cropped picture.
If I use the sized image, it works well.
I have no issue with jpg files.

You can have a look here: https://test.vincentbourganel.fr/news/test-png-files/

Comments

  • acrylian Administrator, Developer

    I have never heard of "dng" files.Judging by your site you apparently mean "png" files?

    png files do not have (support) meta data like jpgs do so that might be an issue here. But the size should be included. But be sure you don't use "cleaned for web" versions as that strips all extra info often.

    GD or Imagick?

    To be able to reproduce any issue we need the values you have used with tinyZenpage. Please add a screenshot of each to that page so we can try ourselves.

  • vincent3569 Member, Translator
    edited February 2019

    my mistake, I was speaking about png files (but btw, DNG files exist: https://en.wikipedia.org/wiki/Digital_Negative)
    I edited title, content and links.

    you can use full image here: https://test.vincentbourganel.fr/albums/images/illustrations/2019.png.

    the picture size of my theme is 800px (for sized image).
    the right generated cache image is /cache/images/illustrations/2019_800.png?cached=1548249339

    the custom size used is 400px.
    the wrong (cropped) generated cache image is /cache/images/illustrations/2019_400.png?cached=1551105491

    btw, I have the same trouble with gig image (example will follow)

  • vincent3569 Member, Translator

    as told before, same trouble with gif files:
    https://test.vincentbourganel.fr/news/test-gif-files/

    with custom size, the picture is cropped and "white" is added at the bottom of the original picture

  • acrylian Administrator, Developer
    edited February 2019

    (but btw, DNG files exist:

    Sure but not a webformat Zenphoto or any other tool could natively process ;-)

    the wrong (cropped) generated cache image is

    Again what are the settings you used to crop? I don't see anything related to cropping there.

    And also again what library: GD or Imagick?

    with custom size, the picture is cropped and "white" is added at the bottom of the original picture

    White usually means transparency got lost. We actually fixed that for png/gif in the support build (which I assume you are using anyway).

  • vincent3569 Member, Translator
    edited February 2019

    I use GD library.
    to create these picturee I use tinyZenpage.
    then I use "Custom size (un-cropped)" of "image size" (set to 400px).

  • vincent3569 Member, Translator
    edited February 2019

    you are right, white means transparency :-)
    of course, as usual, I use the latest build, and in my test case, there no lost transparency, there is a wrong cropping, with "added picture" (the picture is higher than before).

    you can have a look on the generated cache image here: https://test.vincentbourganel.fr/cache/images/illustrations/carte-co_220.gif

  • acrylian Administrator, Developer
    edited February 2019

    Above you wrote:

    when I try to insert a custom sized image with tinyZenpage of a png image, I have a wrong cropped picture.

    So the issue is you get a somehow cropped picture although you wanted an uncropped one? It cannot be a "wrong cropped" image because a "sized image" is of course never cropped.

    Don't mean to be picky as English is of course not the native language for both of us. Just don't want to investigate in the wrong direction! ;-)

  • vincent3569 Member, Translator
    edited February 2019

    for png file, I want a sized image (set 400px, supposed to be the width as it is the longest size)
    but in fact (I don't seen it before), the picture is cropped (as I can see the right of the picture) and is sized to 400px on height value. as the original height was lower than 400px, transparent pixels are added at the bottom of the picture).

    have a look on the generated picture: https://test.vincentbourganel.fr/cache/images/illustrations/2019_400.png

    in fact, it is the issue with png and gif file.

    hope that's more clear.

  • acrylian Administrator, Developer

    Okay, so far understood. It is only an issue with tinyZenpage? You don't get this on the theme itself, right?

  • vincent3569 Member, Translator
    edited February 2019

    I disabled tinymce
    in html content, I add this code:

    <p>&nbsp;</p>
    <p>manually custom sized image (250px) without tinyMCE</p>
    <p><a title="2019" href="/index.php?album=images/illustrations&amp;image=2019.png"><img src="/cache/images/illustrations/2019_250.png" alt="2019" /></a></p>
    

    but the issue is the same (I have a 250 sized picture on the heigh size and not the width, so the picture is cropped and transaprency is added).

    again, have a look here: https://test.vincentbourganel.fr/news/test-png-files/

  • acrylian Administrator, Developer
    edited February 2019

    I can reproduce the issue with the first image that is cropped where it shouldn't. The 2nd even on your site seems to be correctly scaled. I don't see any white or cropping actually.

    tinyZenpage probably does things wrong. Wanted to change that to a content macro anyway some time. That also can better cover missing images and such. Maybe I should do this now…

  • fretzl Administrator, Developer

    It's not specifically a tinyZenpage thing. It's a png/gif thing.
    Use any png/gif file in the zenpage theme for example. You'll see right away that things are wrong.

  • acrylian Administrator, Developer
    edited February 2019

    Well, I tried both example images and I don't see anything wrong in the Zenpage theme. However that is using maxspace images and not standard sized images on the image page. But even with basic all looks as it should to me…

  • acrylian Administrator, Developer

    I also tried on the test install with the basic theme using standard sized images on our server and cannot reproduce it…

  • acrylian Administrator, Developer

    Please try the support build that should work with pngs/gifs correctly now.

  • vincent3569 Member, Translator
    edited March 2019

    hi,
    as far I can test, the fix works well for gif/png files

  • acrylian Administrator, Developer

    Thanks for the confirmation.

Sign In or Register to comment.