[Skip to main content](#vessel-content)

#   Watermark after image resize ?

##

- **[sr9yar](/forum/user/31971-sr9yar "View sr9yar's Profile")**
- [![sr9yar's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31971.jpg)](/forum/user/31971-sr9yar "View sr9yar's Profile") Topic Author
- [ Offline](/forum/user/31971-sr9yar)

Less More

- Posts: 16
- Thank you received: 0
-
-

11 years 2 months ago [\#212543](#212543) by [sr9yar](/forum/user/31971-sr9yar "View sr9yar's Profile")  *[Watermark after image resize ?](/forum/32-content-creation/878954-watermark-after-image-resize#212543 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4  Hi, I have to use the watermark feature since I'm trying not to let other people use my product photos on their websites. As I see it: I upload an image, the watermark is applied, the image is resized. But what if the size of my images is not always the same? Isn't this the point of resize feature in a script? Sure is. But with bigger images my watermark becomes so small I can barely distinguish it. So this leads to inevitable preprocessing, which is really annoying, especially if you need to do it on daily basis.  Do I understand this correctly, that there is no way I can protect my images with watermark feature, if the uploaded images size varies greatly? If no, is it possible to make the script apply watermark after resize with code modification? Maybe you can point me in the right direction, where should I start looking for the relevant part of the code?")* was created by *[sr9yar](/forum/user/31971-sr9yar "View sr9yar's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4

Hi,
I have to use the watermark feature since I'm trying not to let other people use my product photos on their websites.
As I see it: I upload an image, the watermark is applied, the image is resized. But what if the size of my images is not always the same? Isn't this the point of resize feature in a script? Sure is. But with bigger images my watermark becomes so small I can barely distinguish it.
So this leads to inevitable preprocessing, which is really annoying, especially if you need to do it on daily basis.

Do I understand this correctly, that there is no way I can protect my images with watermark feature, if the uploaded images size varies greatly?
If no, is it possible to make the script apply watermark after resize with code modification? Maybe you can point me in the right direction, where should I start looking for the relevant part of the code?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc4OTU0LXdhdGVybWFyay1hZnRlci1pbWFnZS1yZXNpemU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14270
-
-

11 years 2 months ago [\#212561](#212561) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Watermark after image resize ?](/forum/32-content-creation/878954-watermark-after-image-resize#212561 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4  Hi, I have to use the watermark feature since I'm trying not to let other people use my product photos on their websites. As I see it: I upload an image, the watermark is applied, the image is resized. But what if the size of my images is not always the same? Isn't this the point of resize feature in a script? Sure is. But with bigger images my watermark becomes so small I can barely distinguish it. So this leads to inevitable preprocessing, which is really annoying, especially if you need to do it on daily basis.  Do I understand this correctly, that there is no way I can protect my images with watermark feature, if the uploaded images size varies greatly? If no, is it possible to make the script apply watermark after resize with code modification? Maybe you can point me in the right direction, where should I start looking for the relevant part of the code?")*

Hi,

What people do normally in such case is that they use a transparent watermark as big as the biggest image in the shop, and repeat the image of the logo (or whatever) on that transparent image so that regardless of the image size, the watermark will be visible enough.

If you want to modify the code handling the processing of the watermark for the images, you want to edit the file administrator/components/com_hikashop/helpers/image.php and look at the _resizeImage and more specifically that code: Code:

if(!empty($watermark_path)){ list($wm_width,$wm_height) = getimagesize($watermark_path); $padding = 3; $dest_x = $newWidth - $wm_width - $padding; if($dest_x &lt; 0) $dest_x = 0; $dest_y = $newHeight - $wm_height - $padding; if($dest_y &lt; 0) $dest_y = 0; $trnprt_color=null; if(in_array($extension,array('gif','png'))){ $trnprt_indx = imagecolortransparent($img); if ($trnprt_indx &gt;= 0) { $trnprt_color = imagecolorsforindex($img, $trnprt_indx); } } imagealphablending($thumb, false); imagealphablending($watermark, false); $this-&gt;imagecopymerge_alpha($thumb, $watermark, $dest_x, $dest_y, 0, 0, $wm_width, $wm_height, (int)$config-&gt;get('opacity',0),$trnprt_color); imagedestroy($watermark); }

The following user(s) said Thank You: [sr9yar](/forum/user/31971-sr9yar "View sr9yar's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc4OTU0LXdhdGVybWFyay1hZnRlci1pbWFnZS1yZXNpemU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.135 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
