News:

Looking for documentation? Take a look on our wiki

Main Menu

turn off noimage.gif and warning.png

Started by marvays, May 22, 2021, 09:17:48 AM

Previous topic - Next topic

marvays

Hello.
Is it possible to turn off the generation of noimage.gif and warning.png images?

When there is a problem with images on the site (for whatever reason), virtuemart immediately displays noimage.gif or warning.png images. Website audit tools then can't detect the problem because they don't see any missing images.

I speak from personal experience. 3 days ago, 300 product images mysteriously disappeared from my ftp. The site auditor did not detect this once. When the site visitor noticed. And that's not good.

For example, is this option not in the hidden settings of the VM?

Jörgen

QuoteI speak from personal experience. 3 days ago, 300 product images mysteriously disappeared from my ftp.
If the images are gone, how will VM know this ? When it can't se the original image it uses the noimage.gif instead. It does not generate any noimage.gif files.

Removing noimage.gif should do it or make an override to set your own error message. Look also in VM back end under configuration for possible options.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

pinochico

A common mistake made by admin clickers, but unfortunately also by most developers:

They cannot and do not solve the cause of the problem, but they develop patches and fixes (sometimes their own mistakes).

Here you need to find out the reason and ensure that the images are "mysteriously" not lost on the ftp.

Turning off the noimage system is very wrong, especially for many e-shops that import data from their suppliers without images.

And asking for an administrator error by interfering with the core code of the VM is no longer wrong, but more than bold (if my developer does something like that, I prefer to use the word punishable).
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

marvays

Good. I'll explain it differently. So you can understand me.

I don't want to hide the mistake, but find it! For these purposes, I use a tool that looks for errors (broken links, missing images). But if the VM hides the bug by displaying another image instead, no tool in the world will detect it.

But if the VM doesn't do this hiding image errors, the tools will find the error and I can fix it. Do you understand?

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

marvays

Quote from: Jörgen on May 22, 2021, 10:44:47 AM
See my previous answer...
Jörgen
I see it. But that won't solve the problem. The only change will be that the warning.png image will be missing
Plus, it's not a nice hard-to-delete solution. I would like VirtueMart not to do this replacement at all. In order to only and only display the image of the product and if there is a problem with the image, my seo tool will find it. simple solution.

Jörgen

As i är ut if you delete the ONLY copy of noimage.gif VM will find it. If the varning.gif image is displayer instead, remove this also.
Have you even tried this option?
The next option is to do spend 5 min with an override in your template.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

marvays

Quote from: Jörgen on May 22, 2021, 11:25:50 AM
As i är ut if you delete the ONLY copy of noimage.gif VM will find it. If the varning.gif image is displayer instead, remove this also.
Have you even tried this option?
The next option is to do spend 5 min with an override in your template.

Jörgen
Yes he tried. This is because I have the error "missing image warning.png" on the page, because even if I delete the image, the VM still wants to display it.

But your last sentence is exactly what I needed to hear. I thought it was a systemic thing. Not a piece of code in the template. I'm going to look at it. Thank you Jörgen


GJC Web Design

look at function displayMediaThumb() in  \administrator\components\com_virtuemart\helpers\mediahandler.php

perhaps just commenting out  //$this->setNoImageSet();

will be enough to proceed with the missing image path
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

marvays

Quote from: GJC Web Design on May 22, 2021, 12:32:29 PM
look at function displayMediaThumb() in  \administrator\components\com_virtuemart\helpers\mediahandler.php

perhaps just commenting out  //$this->setNoImageSet();

will be enough to proceed with the missing image path
this doesn't work :(

Jörgen

Then You have to tell us what You want to happen. And how it should work.

This is NOT a bug i VM.

Can You not tell your tool to look for links to noimage.gif ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

marvays

I'm not saying it's a VM bug. I don't even think so. I just want VM to do nothing. No replacement.

When a product has a problem, each seo tool finds it with a missing image or a broken link.
See: https://help.ahrefs.com/en/articles/2628254-image-broken-error-in-site-audit

Jörgen

Hello

I am not going to rewrite your code, but here is something to get You started:

In your template file "default:images.php" you will find something like this:
if (!empty($this->product->images)) {
$image = $this->product->images[0];
?>
<div class="main-image">
<?php
$width VmConfig::get('img_width_full'0);
$height VmConfig::get('img_height_full'0);
if(!empty($width) or !empty($height)){
echo $image->displayMediaThumb("",true,"rel='vm-additional-images'"truetruefalse$width$height);
} else {
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
}
 ?>

<div class="clear"></div>
</div>
<?php
}


Test for noimage.gif or empty file name like this:

if (!empty($this->product->images)) {
$image = $this->product->images[0];     
?>
<div class="main-image">
<?php
$width VmConfig::get('img_width_full'0);
$height VmConfig::get('img_height_full'0);

                
// JH 2021-05-23  display a broken link if noimage.gif or no image found

                
if (('' == $image->file_name) or ('noimage'  == $image->file_name)){
                  echo 
'<img src="imageLost.gif" >';  
                } else {   
  if(!empty($width) or !empty($height)){
echo $image->displayMediaThumb("",true,"rel='vm-additional-images'"truetruefalse$width$height);
  } else {
 
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
  }
               }
       ?>

<div class="clear"></div>
</div>
<?php 
}
?>



Code has been tested but rewritten, Not retested.

This will probably have to be impleneted in more places, but you have a starting point. This is a template change.

If You choose to delete the noimage.gif You will probably get a new file on every VM update. The fix should work either way.


Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

@Jörgen

what he wants is for VM to display the broken or non existing file as a 404 so his site checker can detect it and he can fix it

in the function displayMediaThumb() if the image path or file is wrong/missing it will always return the set noimage.gif ...  this happens before the result is sent to the template..

So on the frontend it isn't obvious what the missing file is ... 

but @marvays .. it is obvious what is missing in the admin .. so turn on VM debug and go thru your product admin looking for missing images etc or add some logging in the \administrator\components\com_virtuemart\helpers\mediahandler.php to catch them when rendered at the frontend
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jörgen

@gjc

My solution will give hon a broken link, this is what he is asking asking for.

QuoteI don't want to hide the mistake, but find it! For these purposes, I use a tool that looks for errors (broken links, missing images). But if the VM hides the bug by displaying another image instead, no tool in the world will detect it.
/quote]
Anyway, this is what comes to mind.
Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.