Jump to content

Watermark not working in 1.5.2


Recommended Posts

I have a fresh install of 1.5.2 about 1/2 way into adding images I choose to use the watermark mod.

I used a .gif, file set it up in back off, then regenerated thumbnails, cleared browser cache.

The water mark is only showing up on the product images I added after installing watermark mod.

To test it I changed location of the mark and regenerated the images. Still the water make was only on the after images. I have regenerated all images and had the erase previous images selected.

 

Watermark image used.

post-80008-0-84416000-1354576398_thumb.gif

 

 

Product showing water mark

http://projectpb.com...p/2746-g6r.html

 

Product not showing

http://projectpb.com...-lubricant.html

 

 

Any info will be helpful. If you view site please chime in on how load speed was.

 

Thanks

Jeff

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 1 month later...

I have prestashop 1.5.3.1 with 6 multishops and about 2000 products having 5000 images with 5 types (large / small etc).

 

I generate images in backoffice with the option 'Erase previous images' disabled to prevent resizing all. And since I enabled watermark module it takes ages and will not finish and will not do it's job which is resize only non existing images.

 

Due to a bug in regeneration module whatever you do it will ALLWAYS regenerate ALL watermark images. So if you delete one image from img/p folder and generate it again with 'Erase previous images' disabled then it will nicely regenerate first without watermark and after that the watermark module is requested to redo ALL images. Within watermark module it already takes into account multi shop in case you upload different watermark images. However the regenerate button will ALSO call the watermark per shop which is not needed. I only selected 2 image types to process for watermark. So it requests in my sitatuation 6x5000x2=60000 image resizes with watermark. Even while only 1 should be enough.

 

I developed a solution, just put this in override/controllers/admin/AdminImagesController.php as it solved the issue for me.

 

<?php
class AdminImagesController extends AdminImagesControllerCore {// override _regenerateWatermark to do nothing as it would regenerate ALL images for watermark
protected function _regenerateWatermark($dir) {
  return;
}

// do the watermark per missing image just before the real generation as then the real generation (without watermark) is not needed anymore.
protected function _regenerateNewImages($dir, $type, $productsImages = false){
 if (!is_dir($dir))
  return false;
 if ($productsImages)
 {
  foreach (Image::getAllImages() as $image)
  {
$imageObj = new Image($image['id_image']);
$existing_img = $dir.$imageObj->getExistingImgPath().'.jpg';
if (file_exists($existing_img) && filesize($existing_img)) {
 $needFile=false;
 foreach ($type as $imageType)  
  if (!file_exists($dir.$imageObj->getExistingImgPath().'-'.stripslashes($imageType['name']).'.jpg')) {
   $needFile=true;
   continue;
  }
 if($needFile) {
  Hook::exec('actionWatermark', array('id_image' => $imageObj->id, 'id_product' => $imageObj->id_product));
 }
}
  }
 }  $errors=parent::_regenerateNewImages($dir, $type, $productsImages);
 return $errors;
}
}

Link to comment
Share on other sites

  • 1 month later...

Hi all, i "think" the watermark has trouble if the pic is much bigger than the max display size. OR not jpg if you set to jpg settings in the watermark image settings. I am not sure what is the exact problem however reducing your pic size and uploading as a jpg is not a bad thing for your site backups etc. Water mark works fine if the pic is saved as a 600pc wide x ??? and as a jpeg. And from previous comments on forums i think uploading optimal images is better for ps. So i recommend saving your images as the max dimensions of your ps picture settings and testing. Also if you have set it to jpeg only that may require the pic to be jpg in the watermark settings. not time to test it here, it's working for me so i'll stick to this seting. to verify, large files saved as a format unknown (by the client) dropped the watermark feature. Cheers.

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

I have prestashop 1.5.3.1 with 6 multishops and about 2000 products having 5000 images with 5 types (large / small etc).

 

I generate images in backoffice with the option 'Erase previous images' disabled to prevent resizing all. And since I enabled watermark module it takes ages and will not finish and will not do it's job which is resize only non existing images.

 

Due to a bug in regeneration module whatever you do it will ALLWAYS regenerate ALL watermark images. So if you delete one image from img/p folder and generate it again with 'Erase previous images' disabled then it will nicely regenerate first without watermark and after that the watermark module is requested to redo ALL images. Within watermark module it already takes into account multi shop in case you upload different watermark images. However the regenerate button will ALSO call the watermark per shop which is not needed. I only selected 2 image types to process for watermark. So it requests in my sitatuation 6x5000x2=60000 image resizes with watermark. Even while only 1 should be enough.

 

I developed a solution, just put this in override/controllers/admin/AdminImagesController.php as it solved the issue for me.

 

<?php
class AdminImagesController extends AdminImagesControllerCore {// override _regenerateWatermark to do nothing as it would regenerate ALL images for watermark
protected function _regenerateWatermark($dir) {
  return;
}

// do the watermark per missing image just before the real generation as then the real generation (without watermark) is not needed anymore.
protected function _regenerateNewImages($dir, $type, $productsImages = false){
 if (!is_dir($dir))
  return false;
 if ($productsImages)
 {
  foreach (Image::getAllImages() as $image)
  {
$imageObj = new Image($image['id_image']);
$existing_img = $dir.$imageObj->getExistingImgPath().'.jpg';
if (file_exists($existing_img) && filesize($existing_img)) {
 $needFile=false;
 foreach ($type as $imageType)  
  if (!file_exists($dir.$imageObj->getExistingImgPath().'-'.stripslashes($imageType['name']).'.jpg')) {
   $needFile=true;
   continue;
  }
 if($needFile) {
  Hook::exec('actionWatermark', array('id_image' => $imageObj->id, 'id_product' => $imageObj->id_product));
 }
}
  }
 }  $errors=parent::_regenerateNewImages($dir, $type, $productsImages);
 return $errors;
}
}

 

Thank you! It solved the problem for me. The only solution that works! Prestashop version 1.5.3.1

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
  • 3 weeks later...

Bonjour,

 

Same problem with me in PS 1.5.6.0 and Watermark 0.4.

The regeneration runs with 7 errors with 2000 pictures and no watermark but with new added pic it works.

 

I have try with cache off and img/p directory with full access.

 

Any solution welcome.

 

Jean-Marie

Link to comment
Share on other sites

  • 4 weeks later...

Is it a piece of crap ?

 

I have been losing time for days on this issue.

Watermark used to work perfectly, even with the regenerate function.

After upgrading to 1.5.6.2 it is the same as you.

I tried everything, nothing work, find no reason why, no one knows, etc.

 

I had a backup and I will just restore the ancient img/p folder (all images were regenerated yes, but without watermark).

Maybe you can try the same until modules communicate properly ?

Link to comment
Share on other sites

  • 3 weeks later...

just dropped the file into the watermark module folder (via ftp). named it "watermark.gif"  seems to work. Hopefulliy it will for others. The other step i took was to upload the file to the watermark module as watermark.gif so It might be looking for that file to use. Even though when the module is reloaded it says "no file selected".  Anyway something i did seems to have it working on the Version : 0.6   module  Hope that helps someone.

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...

I use Prestashop  1.5.6.2 and watermark version 0.7. My store is not s big, I have around 500 products , each with 5-6 images. After adding the proucts I realize that I need some watermark, so I install the module. If I add a new image the module works and on this image the watermark appers. But when I try to regenerate images ( all, only home default, only large default, etc) , but  the watermark is not added. I try with erase thumbnail option and without it several times. I think I covered all options , and read every post from forum.

This is my server config:

server: LiteSpeed

 PHP: 5.3.28

memory limit: 192M

max execution: 39990

 

I know that  max execution time is big, but every time the script give me server error  and no watermark on images.

 

 

Any advice?

Link to comment
Share on other sites

I use Prestashop  1.5.6.2 and watermark version 0.6 and my store is big enough (around 7000 products).

 

I have or had :) the same problem but it seems that I solved it, working hard.

 

1. The watermark should be big enough. I use 320 x 107 . Deactivate the watermark module.

 

2. Stop any Cloud service if you use one.

 

3. Regenerate product images step by step ( first only home, second only large, etc), with erase thumbnail option checked.

 

If your server stop to respond, regenerate product images for that dimension where the error appeared, but with erase thumbnail option unchecked.

 

4. Install and activate the watermark module

 

5. Regenerate product images only for home (or only for  large) dimension, with erase thumbnail option checked.

 

6. In case of server error, regenerate product images for dimension chose at step 4, but with erase thumbnail option unchecked.

 

7. Repeat the step 6, until all images on the website will have the watermark applied (I repeated around 30 times)

 

It seems that the errors are generated by the server. (Don't forget to switch on the Cloud if you stop it)

 

Also, in order to apply the watermark, be aware that you need to regenerate only a dimension. The module will apply the watermark on all images selected in module settings.

 

PS I spent 4 hours to apply the watermark on all pictures.

Edited by AdyPresta (see edit history)
Link to comment
Share on other sites

I use Prestashop  1.5.6.2 and watermark version 0.6 and my store is big enough (around 7000 products).

 

I have or had :) the same problem but it seems that I solved it, working hard.

 

1. The watermark should be big enough. I use 320 x 107 . Deactivate the watermark module.

 

2. Stop any Cloud service if you use one.

 

3. Regenerate product images step by step ( first only home, second only large, etc), with erase thumbnail option checked.

 

If your server stop to respond, regenerate product images for that dimension where the error appeared, but with erase thumbnail option unchecked.

 

4. Install and activate the watermark module

 

5. Regenerate product images only for home (or only for  large) dimension, with erase thumbnail option checked.

 

6. In case of server error, regenerate product images for dimension chose at step 4, but with erase thumbnail option unchecked.

 

7. Repeat the step 6, until all images on the website will have the watermark applied (I repeated around 30 times)

 

It seems that the errors are generated by the server. (Don't forget to switch on the Cloud if you stop it)

 

Also, in order to apply the watermark, be aware that you need to regenerate only a dimension. The module will apply the watermark on all images selected in module settings.

 

PS I spent 4 hours to apply the watermark on all pictures.

Thank you for the reply.

I will try your method but first I want to be clear in some steps if you can answer me:

 

In step 1, deactive module , you uninstall it or just deactivate, I ask this because in step6 you said install and activate ??

 

An by this: "Also, in order to apply the watermark, be aware that you need to regenerate only a dimension.. " - in my case I use 4 dimensions for product picturesL home, medium, large, XL - what did you meant by say this- to regerate one dimension by time?

And this " The module will apply the watermark on all images selected in module settings" ,in my settings I checked all the boxes- I must check only those 4 types?

 

Thanks in advance.

Link to comment
Share on other sites

Thank you for the reply.

I will try your method but first I want to be clear in some steps if you can answer me:

 

In step 1, deactive module , you uninstall it or just deactivate, I ask this because in step6 you said install and activate ??

 

An by this: "Also, in order to apply the watermark, be aware that you need to regenerate only a dimension.. " - in my case I use 4 dimensions for product picturesL home, medium, large, XL - what did you meant by say this- to regerate one dimension by time?

And this " The module will apply the watermark on all images selected in module settings" ,in my settings I checked all the boxes- I must check only those 4 types?

 

Thanks in advance.

 

Hi,

 

1. In the first step is important that the watermark module to NOT be active (so it can be uninstalled or deactivate). The main idea of this point is to restore all your images as originals, without watermark.

 

The above is linked to "Also, in order to apply the watermark, be aware that you need to regenerate only a dimension.. ". In some cases, restoring the images as originals generates an error, also. So, in this step, regenerating dimensions one by one will avoid such errors.

 

In your specific case, after you "put on hold" the watermark module, you will:

- regenerate products images for home dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for home dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for medium dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for medium dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for large dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for large dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for XL dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for XL dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

 

In this moment all images are in their place, without watermark.

 

2. In the second step the watermark module must be active (installed and activated)

 

How it's working the regeneration process in this step:

- the system will restore all selected dimensions as you did it in the above first step. That I said in the first post "5. Regenerate product images only for home (or only for  large) dimension, with erase thumbnail option checked".

- taking picture by picture, the system will generate an watermark image which is saved on the server and applied over the existing images (only over the dimensions set in watermark module settings, but which exist in the product dimensions). So, even you checked all the boxes in your settings, for the product regeneration, the watermark will be applied only on products dimensions. Because you have selected all boxes in module settings, if you'll select another image category or all categories in the regeneration process, the watermark will be applied over their dimensions. I recommend you to check only your product 4 types.

 

The regeneration with watermark is a very hard process for your server, that, in case of server error, repeat the regeneration process with the same settings (Image: Product + Dimension: Home), but with erase thumbnail option UnChecked, until you succeed to apply the watermark on all pictures.

 

Good luck and patience!

Link to comment
Share on other sites

Hi,

 

1. In the first step is important that the watermark module to NOT be active (so it can be uninstalled or deactivate). The main idea of this point is to restore all your images as originals, without watermark.

 

The above is linked to "Also, in order to apply the watermark, be aware that you need to regenerate only a dimension.. ". In some cases, restoring the images as originals generates an error, also. So, in this step, regenerating dimensions one by one will avoid such errors.

 

In your specific case, after you "put on hold" the watermark module, you will:

- regenerate products images for home dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for home dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for medium dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for medium dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for large dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for large dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

- regenerate products images for XL dimension, with erase thumbnail option UnChecked. In case of error, regenerate again products images for XL dimension, with erase thumbnail option Checked, until you succeed to regenerate all images for this dimension.

 

In this moment all images are in their place, without watermark.

 

2. In the second step the watermark module must be active (installed and activated)

 

How it's working the regeneration process in this step:

- the system will restore all selected dimensions as you did it in the above first step. That I said in the first post "5. Regenerate product images only for home (or only for  large) dimension, with erase thumbnail option checked".

- taking picture by picture, the system will generate an watermark image which is saved on the server and applied over the existing images (only over the dimensions set in watermark module settings, but which exist in the product dimensions). So, even you checked all the boxes in your settings, for the product regeneration, the watermark will be applied only on products dimensions. Because you have selected all boxes in module settings, if you'll select another image category or all categories in the regeneration process, the watermark will be applied over their dimensions. I recommend you to check only your product 4 types.

 

The regeneration with watermark is a very hard process for your server, that, in case of server error, repeat the regeneration process with the same settings (Image: Product + Dimension: Home), but with erase thumbnail option UnChecked, until you succeed to apply the watermark on all pictures.

 

Good luck and patience!

 I follow your steps , but no luck for me.

First I uninstall the watermark module, then regenerate images, format by format.

Every format regeneration return the success message in less then 5 minute.

After that I install the watermark module, version 0.6, and configure it. 

Then I start the regeneration for the first format. After 10 minute ( this is my  server max_execution time setting) the error message appers. So I uncheck the delete option, and star again. I do this about 10 times but I didn't receive the success message.

I check the pictures in front end, and a few of them have watermark ( about 10%), the rest don't have.

 

I start over ( uninstall, regenerate clean images) and I install the watermark v 0.7, and re-run the regeneration. But still same result: only few images with watermark and no success message after around 7 regeneration restart.

 

Have you any hints for me? Or is there an way to what by logs what is happening during watermark regeneration? Because , my quess , that in module script is the problem. At some point , it break down, and from that point no image is regenerated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...