• Are there any limitations with image sizes? I have an image size that’s 1920x600px (for page headers.)

    I’ve noticed that if my uploaded image is more than 4000px wide, I cannot crop that image size. I can crop thumbnails and other sizes, but the 1920×600 image size has a red crop icon in the lower right corner. Which seems to indicate that the image cannot be cropped.

    Any ideas?

    Thanks.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    I think the limiting factor is the php-memory. If its to small the cropping might fail. Try to run the “Plugin-Quick-Test” (settings > Crop-Thumbnails) and paste the output here. The Quick-Test will display the php-memory and some other system informations.

    Thread Starter metaglyphics

    (@metaglyphics)

    INFO Crop-Thumbnails 1.2.4
    INFO PHP 7.3.5-1+ubuntu18.04.1+deb.sury.org+1
    INFO PHP memory limit 512M
    INFO WP_Image_Editor_Imagick (choosed WordPress imageeditor class for jpg)
    SUCCESS Temporary directory exists
    SUCCESS Copy testfile to temporary directory
    SUCCESS Testfile was successfully added to media-library. (ID:664)
    SUCCESS Cropping the file
    SUCCESS Cropped image dimensions are correct.
    SUCCESS Test-attachement successfull deleted (ID:664)
    SUCCESS Remove testfile from temporary directory
    INFO Tests complete

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Your Memory limits seems to be ok. Have you tried to crop the image?
    What size has the image you want to crop?

    Thread Starter metaglyphics

    (@metaglyphics)

    It seems any image where the original is more than 3000px fails to be cropped.

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Did WordPress was able to create the cropped image sizes after upload?

    Thread Starter metaglyphics

    (@metaglyphics)

    There is an image for each size. I just can’t crop manually.

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Thats very strange – i use the wordpress internal functions for cropping. So if wordpress can crop the image the plugin should work also. If you hover above the warning sign – what message text appear?

    Thread Starter metaglyphics

    (@metaglyphics)

    It says “Not Yet Cropped By WordPress.”

    Here’s a screenshot:

    https://www.dropbox.com/s/cnu396drsxeo5u6/image%20crop.png?dl=0

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Did you add the image-sizes (the definition of the sizes) by code or by an plugin?

    Thread Starter metaglyphics

    (@metaglyphics)

    By code. In my functions.

    Thread Starter metaglyphics

    (@metaglyphics)

    I have quite a few images where certain sizes reject cropping.

    Here are a couple of examples:

    https://www.dropbox.com/s/cnu396drsxeo5u6/image%20crop.png?dl=0

    https://www.dropbox.com/s/lq7yuin9cqny5ll/Image%20Crop%20screenshot.png?dl=0

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    I can only guess – there is something wrong with the metadata that are stored for the images in your database. For every image wordpress stores a metadata-record with all the image-sizes.

    If the metadata are not present (or corrupted) my plugin will think, that the image is not yet present (if i remembered my code correct). But a recrop then should apply all nessessary metadata.

    You may activate the debug logging in my Plugins settings screen to get more information about the images and the crop process.

    Did you use any additional plugins that has something to do with images?

    Also sorry for my slow responses – im kind of bussy in the last weeks.

    Hey Volkmar,

    I am experiencing the same issue with cropping one custom set image size (set via functions.php). I’ve found it has been related to images over ~6000px wide. From the screenshot, you can see the other custom image sizes were successfully cropped.

    https://www.dropbox.com/s/4dvgwdq640rllqx/crop_thumbnails.png?dl=0

    Here’s my debug output:

    [
      "validated input data",
      {
        "selection": {
          "x": 0,
          "y": 1658,
          "x2": 7151,
          "y2": 4087,
          "w": 7151,
          "h": 2428.8708939065878
        },
        "sourceImageId": 8015,
        "activeImageSizes": [
          {
            "name": "blog-wide",
            "width": 2650,
            "height": 900,
            "ratio": 2.9444444444444446,
            "crop": 1
          }
        ]
      },
      "Image filename has changed (blog-wide)",
      "filename: /nas/content/live/explorerstage/wp-content/uploads/2019/02/menu-board-case-study-2650x900.jpg",
      "error on menu-board-case-study-2650x900.jpg",
      {
        "blog-wide": [
          "Can't copy temporary file to media library.",
          "Can't delete temporary file."
        ]
      }
    ]

    Here is the plugin test output:

    info Crop-Thumbnails 1.2.5
    info PHP 7.2.23-1+ubuntu18.04.1+deb.sury.org+1
    info PHP memory limit 512M
    info WP_Image_Editor_Imagick (choosed WordPress imageeditor class for jpg)
    success Temporary directory exists
    success Copy testfile to temporary directory
    success Testfile was successfully added to media-library. (ID:8017)
    success Cropping the file
    success Cropped image dimensions are correct.
    success Test-attachement successfull deleted (ID:8017)
    success Remove testfile from temporary directory
    info Tests complete

    Here’s what I’ve tried:

    – ran image through compressor as well as re-saved the image (removing all original meta data). Both of these tests resulted in same error.
    – resized the image to 5500px and cropping worked

    Please let me know what I can try to further debug this issue. Thanks in advance.

    Thread Starter metaglyphics

    (@metaglyphics)

    This might be a part of the issue: If your custom image size specifies a height AND width, it might not be created, depending on the original image aspect ratio.

    I changed my image size to 1920×0, and that seems to have resolved the issue for me so far. But I’ll keep testing…

    Thanks for the insight. Unfortunately, I need a specific aspect ratio for these custom image sizes so I don’t think that will work for me here.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Image Size Limitations’ is closed to new replies.