Latest News Plus on J4: The image file does not exist.

Hi all,
I've found the Latest News Plus Date Module for Joomla 3 fantastic!
I have tested the version on Joomla 4 but it doesn't works if a Article has a images.
It works normally without Articles Image (even Intro or Full), but at the first save with Image I get a blank Frontpage with: "The image file does not exist.".
In Folder images/thumbnails/mod_latestnewsplusdate/ no images has been created... this is always empty.
I have checked the source code and done some tests, but I can't find any errors...

I hope it can be helpfull.

Joomla 4.0.3
PHP 7.4 on Linux Apache
Cassiopeia Default Template
       
  • Replied by admin on Tuesday, May 31 2022, 03:14 PM · Hide· #1
    Ah, Thanks again fabrizio ;)
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by fabrizio966 on Friday, May 27 2022, 02:02 PM · Hide· #2
    Occasionally it happens that a customer makes a mistake with the images of the articles. To prevent the Module from blocking the entire site I made this small change in the Helper.
    If there is an error in the Path to the image, then an error JPG is shown, in the same way as the default image.
    You have to prepare a JPG called error.jpg and put it in the Assets folder.

    From this

    // If article contains an image then generate a thumbnail
    if($orig_image != ""){
    $image = new Image($orig_image);
    $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
    $thumb = $resizedImage->toFile(JPATH_BASE.'/'.$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg', IMAGETYPE_JPEG, array('quality' => 70));

    $thumb_img = '<img src="'.Uri::root().$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'"/>';

    } else {...


    To this

    // If article contains an image then generate a thumbnail
    if($orig_image != ""){

    // Load error.jpg if there si a problem on image path
    if(File::exists($orig_image)){
    $image = new Image($orig_image);
    $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
    $thumb = $resizedImage->toFile(JPATH_BASE.'/'.$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg', IMAGETYPE_JPEG, array('quality' => 70));
    $thumb_img = '<img src="'.Uri::root().$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'"/>';
    }else{
    $thumb_img = '<img src="'.Uri::root().'modules/'.$modulebase.'/tmpl/assets/error.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'" />';
    }

    } else {...


    I hope it can be helpful
  •  
  • Replied by fabrizio966 on Friday, May 27 2022, 02:01 PM · Hide· #3
    Occasionally it happens that a customer makes a mistake with the images of the articles. To prevent the Module from blocking the entire site I made this small change in the Helper.
    If there is an error in the Path to the image, then an error JPG is shown, in the same way as the default image.
    You have to prepare a JPG called error.jpg and put it in the Assets folder.

    From this

    // If article contains an image then generate a thumbnail
    			if($orig_image != ""){
    				$image = new Image($orig_image);
    				$resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
    				$thumb = $resizedImage->toFile(JPATH_BASE.'/'.$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg', IMAGETYPE_JPEG, array('quality' => 70));
                    
    				$thumb_img = '<img src="'.Uri::root().$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'"/>';
                    
    			} else {...



    To this

    // If article contains an image then generate a thumbnail
    			if($orig_image != ""){
                    
                    // Load error.jpg if there si a problem on image path
                    if(File::exists($orig_image)){
    				    $image = new Image($orig_image);
    				    $resizedImage = $image->cropResize($thumb_width, $thumb_height, true);
    				    $thumb = $resizedImage->toFile(JPATH_BASE.'/'.$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg', IMAGETYPE_JPEG, array('quality' => 70));
    				    $thumb_img = '<img src="'.Uri::root().$thumb_folder.$thumb_alias.'-'.$thumb_name.'.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'"/>';
                    }else{
                        $thumb_img = '<img src="'.Uri::root().'modules/'.$modulebase.'/tmpl/assets/error.jpg" alt="'.$title.'" width="'.$thumb_width.'" height="'.$thumb_height.'" />';
                    }
                    
    			} else {...



    I hope it can be helpful
  •  
  • Replied by EJBJane on Wednesday, October 27 2021, 02:56 PM · Hide· #4
    Can you give me some feedback please on how this is working out?
  •  
  • Replied by admin on Monday, October 25 2021, 02:22 PM · Hide· #5
    Hi EJB, The latest version includes fixes for JCE issues. Can you tell me whether your Joomla 4 is an upgrade from the beta version or a fresh installation?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by EJBJane on Monday, October 25 2021, 10:52 AM · Hide· #6
    I downloaded the latest version of Related Items but it doesn't help my image problem, also Joomla 4. I also am using JCE Editor.
    Is there something special I need to do to make it work?
  •  
  • Replied by admin on Friday, October 01 2021, 03:38 PM · Hide· #7
    Ah ok. Glad it worked out ;)
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by fabrizio966 on Friday, October 01 2021, 02:13 PM · Hide· #8
    Hi dear Friends,
    yes, it works now, many thanks!

    I have only found and fixed a small flaw in the rendered paths of images, because Uri::root() returns a path with slash at the end.
    If we have $thumb_folder = "/images/thumbnails/..." in PHP entry point, we get in output something like this:

    https://www.domain.com//images/thumbnails/...

    with double slash between domain and images folder.

    NOTICE: This small problem was in the old J3 version too, but I had fixed it on my own.

    ===

    Very nice extension, I love it !!!
    Thanks a lot.

    Fabrizio
  •  
  •  
    Replied by admin on Friday, October 01 2021, 07:15 AM · Hide· #9
    Hi, I have updated the module with bugfixes for Joomla 4. Please re-download and try again
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments