Post by jwreid » Wed Feb 08, 2017 8:05 am

Hello, I installed a xml file for my watermark. The problem I am experiencing is the watermark is set to only display watermark on images bigger than 90px X 90px. I would like to know the mod for putting a ceiling on that size, say nothing over 300px X 300px will display a watermark. My banners are showing watermark and I do not want this.
Here are the lines in the xml that call this out. Thanks for your time.
Jason

<file name="catalog/model/tool/image.php">
<operation>
<search position="after"><![CDATA[
$image = new Image(DIR_IMAGE . $old_image);
]]></search>
<add><![CDATA[
if ($width > 90 || $height > 90) {
$image->watermark(DIR_IMAGE . '/watermark.png', 'center');
}

User avatar

Posts

Joined
Sun Oct 27, 2013 6:27 pm
Location - Canada

Post by jwreid » Wed Feb 08, 2017 6:16 pm

Okay after some research I found the solution. I have manufacturers logos on my product page with a width of 90 px and I have banners that have a width of 750 px. My product pics are 250 px wide, so my 'if ' statement is now this - if ($width > 90 px && $width < 251 px). Now the only images with a watermark are product pics. I hope this helps others.
Thanks
Jason

User avatar

Posts

Joined
Sun Oct 27, 2013 6:27 pm
Location - Canada