• Resolved gamerevolt

    (@gamerevolt)


    When viewed in slider mode, tall thin images have the wrong thumbnail picked. Test this on smaller browser window heights.

    Contest-gallery works out the ‘optimal’ width of the image to pick based on the known dimensions of the image and the known vertical space:

    widthCgCenterImageDiv = newHeightImage*widthImage/heightImage;

    It then goes on to pick the optimal image based on what thumbnail has minimally higher width than this image:

    if(widthCgCenterImageDiv<parseInt(cgJsData[gid].vars.rawData[realId][‘thumbnail_size_w’])){var backGroundUrl = cgJsClass.gallery.function.general.tools.checkSsl(mainObject[‘thumbnail’]);}
    else if(widthCgCenterImageDiv<parseInt(cgJsData[gid].vars.rawData[realId][‘medium_size_w’])){var backGroundUrl = cgJsClass.gallery.function.general.tools.checkSsl(mainObject[‘medium’]);}
    else if(widthCgCenterImageDiv<parseInt(cgJsData[gid].vars.rawData[realId][‘large_size_w’])){var backGroundUrl = cgJsClass.gallery.function.general.tools.checkSsl(mainObject[‘large’]);}
    else{
    var backGroundUrl = cgJsClass.gallery.function.general.tools.checkSsl(mainObject[‘full’]);
    }

    However, this is an incorrect calculation. The thumbnail_size_w come from WordPress’s configured thumbnail bounding box sizes. The actual width of thumbnails may be less than this, due to how bounding box thumbnailing works.

    You either need to run your computation based on the actual width of the thumbnail (not the config option), or you need to do the “minimally higher” check with constraints both on width and height.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    so you mean if change here Settings >>> Media the settings

    https://www.screencast.com/t/DsQCd2nlq

    The new settings will be saved and taken.

    But the upload was done with old settings

    https://www.screencast.com/t/x3hmHWTcoXR

    Yes, you are right. Thanks for this hint.

    I will improve it in comming updates soon, this week I think.

    Kind regards
    Wasiliy

    Thread Starter gamerevolt

    (@gamerevolt)

    No, nothing to do with changing existing settings.

    But it does relate to the ‘Crop thumbnail to exact dimensions’ setting there.
    Your code is assuming the thumbnail width matches the ‘Width’ configured here, when actually the width may have been cropped.

    Test yourself with say uploading a 1000×6000 image. Look at the image thumbnail in slider mode on a smaller screen size and observe that the wrong thumbnail is being picked.

    • This reply was modified 4 years, 8 months ago by gamerevolt.

    Please check the newest version 10.9.8.8.0.

    Real width calculation will be done now in
    cgJsClass.gallery.function.general.tools.calculateSizeImageDataPreProcess
    or
    cgJsClass.gallery.function.general.tools.calculateSizeGetJsonImageData
    functions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug with tall thin images (wrong thumbnail)’ is closed to new replies.