• Hello, I have recently installed this plugin. I have also created some templates and try to send them without problems.
    I have local installation of wordpress with virtual machine anche for this reason we need to insert the images from URL.
    I tried with the editor.
    What I do is:
    Modify a newsletter, select the image to change, click on image button, near the url image, then select “insert image from url” and paste an url of an image (we tried with bigger or smaller images).
    The image is displayed correctly in this page but when I press “insert image” and error appears:
    Knews: Error: file doesn’t exist?

    This problem happens with every templates avaible.

    It’s possibile to solve this problem?

    https://www.ads-software.com/extend/plugins/knews/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Grupporetina

    (@grupporetina)

    We have found the error in the file wp-content/plugins/knews/includes/resize_img.php
    This file try to save the image but the path was wrong.
    The original file was:

    if (is_file($wp_dirs['basedir'] . $url)) {
                                       $size = getimagesize($wp_dirs['basedir'] . $url);
                                       if ($size[0]==$width && $size[1]==$height) {
    
                                                   $jsondata['result'] = 'ok';
                                                   $jsondata['url'] = $wp_dirs['baseurl'] . $url;
                                                   return $jsondata;
                                       }
                            }

    This is our modification to let the insert from url of images work:

    if (is_file( $wp_dirs['basedir'] . $url)) {
                                       $size = getimagesize($wp_dirs['basedir'] . $url);
                                       if ($size[0]==$width && $size[1]==$height) {
    
                                                   $jsondata['result'] = 'ok';
                                                   $jsondata['url'] = $wp_dirs['baseurl'] . $url;
                                                   return $jsondata;
                                       }
                            }
                            elseif ( preg_match('/^http/i', $url)) {
                                       $jsondata['result'] = 'ok';
                                       $jsondata['url'] = $url;
                                       return $jsondata;
                            }

    This modification consider the image url only and it’s not saved in the file system.

    Hope this help for a fix ??

    Thread Starter Grupporetina

    (@grupporetina)

    We made another fix for the image from url. If you try to use and image from another wordpress using its url you got the same error “Image doesn’t exists”. We fix also the image from asp urls.

    So change:

    elseif ( preg_match('/^http/i', $url)) {
     $jsondata['result'] = 'ok';
     $jsondata['url'] = $url;
     return $jsondata;
     }

    with:

    elseif ( preg_match('/^http/i', $url_img)) {
    			$jsondata['result'] = 'ok';
    			$jsondata['url'] = $url_img;
    			return $jsondata;
    		}

    Hope this will help too ??

    Plugin Author creverter

    (@creverter)

    Hello @grupporetina… it’s a good appointment, we will include it in future…

    But should include a blocking option to resize the image, and get the real image size & change in the newsletter… because some versions of outlook ignores the width & height attributes, and we won’t distorsion in images…

    We will study it, adding some advice and blocking the resize for this external images…

    Kind regards,
    Carles Reverter.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error: Insert image from URL’ is closed to new replies.