Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • flawes

    (@flawes)

    any reason why you are not using
    =^(.*/)((?<name>[^/]+?)(?<ext>.\w+))$= as a regex?
    since there is almost no comment in your source, it’s hard to figure out for me…

    flawes

    (@flawes)

    No it’s not. and I fear this is working as designed.
    4 => ‘-50×50’,
    ‘x’ => ’50’,
    5 => ’50’,
    ‘y’ => ’50’,
    6 => ’50’,
    I think you are using “x” and “y” as well as “ext” for further processing. the stupid naming of the uploaded image will always lead you to a “don’t know what to do” situation. even scanning meta sizes won’t help:
    This is no full size image. Scanning meta sizes: Array ( [width] => 4000 [height] => 3000 [file] => 2016/04/tolles-bild-50×50.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => tolles-bild-50×50-150×150.jpg [width] => 150 [height] => 150 [mime-type] => image/jpeg…….

    suggest 2 options πŸ™‚ :

    1. documentation change: never upload an image named bla-30×30.[png|jpg]
    2. using another way to find the dimensions of the image so your calculation for the watermark sizing and probably other things can be done properly.

    Paths found for the image: Array ( [thumbfile] => Nacht2a-30x30cm-798×[email protected] [attachmentfile] => Nacht2a-30x30cm-798×[email protected] [thumbupload] => 2016/04/Nacht2a-30x30cm-798×[email protected] [attachmentupload] => 2016/04/Nacht2a-30x30cm-798×[email protected] [thumbabs] => /…./wp-content/uploads/2016/04/Nacht2a-30x30cm-798×[email protected] ) Wrong number of attachments: Array ( ) #0 AddWatermarkRequest->error404() called at [/…./wp-content/plugins/add-watermark/add-watermark.php:755] #1 AddWatermarkRequest->searchAttachments() called at [/…./wp-content/plugins/add-watermark/add-watermark.php:643] #2 AddWatermarkRequest::runAjax() called at [/…./wp-includes/plugin.php:525] #3 do_action(wp_ajax_watermark_image) called at [/…./wp-admin/admin-ajax.php:89]

    ..and this file exists: [thumbabs] => /…./wp-content/uploads/2016/04/Nacht2a-30x30cm-798×[email protected]
    as well as this one:
    [thumbabs] => /bla/bla/bla/bla/bla/wp-content/uploads/2016/04/tolles-bild-50×50.jpg

    i was digging around a bit this morning…

    for me it looks like some mismatch in function getPaths() of your plugin.

    for the example problem, where the uploaded file was called “tolles-bild-50×50.jpg, it seems that WP strips “50×50”:
    Array ( [thumbfile] => tolles-bild-50×50.jpg [attachmentfile] => tolles-bild.jpg [thumbupload] => 2016/04/tolles-bild-50×50.jpg [attachmentupload] => 2016/04/tolles-bild.jpg [thumbabs] => /bla/bla/bla/bla/bla/wp-content/uploads/2016/04/tolles-bild-50×50.jpg )

    couldn’t dive deep enough to understand all your coding…
    either that regex is too strict, or you pick up the wrong elements in the array… πŸ™‚

    Hi Michael,
    were you able to reproduce the “tolles-bild” example issue?

    maybe we should open a new topic.
    i think what we are discussing now is not a strickt WP4.5 related topic. i have seen that the initiator of this topic has a watermark in his images meanwhile…. but it is up to you michael.

    the avada theme is creating them. there are a lot of other resizes that are handled fine by add_watermark like this one for example:
    listing of add_watermark cache:
    ls -l ../02/gedanken2*
    -rw-r–r– 1 x x 5518 Apr 19 13:55 ../02/gedanken2-30x30cm-150×150.jpg
    -rw-r–r– 1 x x 14951 Apr 19 13:56 ../02/gedanken2-30x30cm-300×214.jpg
    -rw-r–r– 1 x x 19976 Apr 24 10:13 ../02/gedanken2-30x30cm-300×300.jpg
    -rw-r–r– 1 x x 29692 Apr 24 10:12 ../02/gedanken2-30x30cm-460×295.jpg
    -rw-r–r– 1 x x 1510 Apr 19 13:56 ../02/gedanken2-30x30cm-66×66.jpg
    -rw-r–r– 1 x x 142678 Apr 19 13:56 ../02/gedanken2-30x30cm.jpg
    i still assume that this is related to the naming of those images. in the “tolles-bild” example above add_watermark fails to handle the fullsize image called “tolles-bild-50×50.jpg” while that one with appended “cm” is working fine. those @2x images might have the same reason for a failure.

    another hint for you πŸ˜‰
    just remember that i had an image (resizes) not watermarked because of the image name… look at this:
    https://ulla.duschau.de/tolles-bild-50×50/ click on image and failure
    https://ulla.duschau.de/tolles-bild-50x50cm/ all good

    ok, here what i found after deleting one of the images and doing a fresh upload:
    in upload dir:
    -rw-r–r– 1 x x 10609 Apr 24 12:56 Nacht2a-30x30cm-150×150.jpg
    -rw-r–r– 1 x x 17610 Apr 24 12:56 Nacht2a-30x30cm-300×132.jpg
    -rw-r–r– 1 x x 30488 Apr 24 13:02 Nacht2a-30x30cm-320×202.jpg
    -rw-r–r– 1 x x 397980 Apr 24 13:09 Nacht2a-30x30cm-798×[email protected]
    -rw-r–r– 1 x x 118224 Apr 24 13:09 Nacht2a-30x30cm-798×351.jpg
    -rw-r–r– 1 x x 147688 Apr 24 13:01 Nacht2a-30x30cm-850×374.jpg
    -rw-r–r– 1 x x 137957 Apr 24 12:56 Nacht2a-30x30cm.jpg

    in add_watermark cache:
    -rw-r–r– 1 x x 6844 Apr 24 13:01 Nacht2a-30x30cm-150×150.jpg
    -rw-r–r– 1 x x 10891 Apr 24 13:01 Nacht2a-30x30cm-300×132.jpg
    -rw-r–r– 1 x x 19673 Apr 24 13:02 Nacht2a-30x30cm-320×202.jpg
    -rw-r–r– 1 x x 105138 Apr 24 13:01 Nacht2a-30x30cm-850×374.jpg
    -rw-r–r– 1 x x 108108 Apr 24 12:58 Nacht2a-30x30cm.jpg

    Nacht2a-30x30cm-798×[email protected] and Nacht2a-30x30cm-798×351.jpg are somehow not handled. they show up as broken images

    Hi,
    I can confirm that “add watermarks” is working after uploading new images on wp4.5, although i experience problems with blog post images that are not shown in my theme (404).
    couldn’t trace it down yet, but all i can see is, that it is retina related..
    it’s a resized image that is available as retina aside to the “normal” resize. (https://ulla.duschau.de/2016/02/7-neue-bilder-online/ best to see with chrome, while ff doesn’t show the broken image)

Viewing 10 replies - 1 through 10 (of 10 total)