G2Image - Image missing watermark sign

yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Sat, 2007-10-27 09:50

Hi,

why is the watermark missing when I add an photo with G2Image?

Is there an option to let the watermark sign show up with a photo in my posts?

Thanks for letting me know!

Yogie

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sat, 2007-10-27 22:31

When does the watermark not show, on your blog or when you click on the image. Are you using resized images, do they have Watermarks in Gallery2?
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Sun, 2007-10-28 13:40

Hi,

when I add an image with G2Image into a wordpress post or site there is no watermark at the image. When I click on the image to see the album or the photo in the album the watermark is there. In Gallery all my pictures have watermarks beside the thumbs.

Any hints?

(http://www.yogie.de/wp/?p=20)

Kind regards and thanks in advance!
Yogie

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sun, 2007-10-28 21:39

How are you specifying this image on http://www.yogie.de/wp/?p=20? Have you specified a size because this image looks larger than a standard thumbnail..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-10-28 23:14

In your G2 Site Admin, what do you have set under Watermarks -> Edit -> " Choose which versions of the image you'd like to watermark"?

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Mon, 2007-10-29 13:58

Hi,

I added it with the G2Image picker and the option "Fullsized image with link to Gallery page for image (HTML)" , at Gallery2 I choose watermark all except thumbnails.

Yogie

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-29 14:24
yogie.de wrote:
I added it with the G2Image picker and the option "Fullsized image with link to Gallery page for image (HTML)" , at Gallery2 I choose watermark all except thumbnails.

I can replicate this on my dev box.

It's interesting that WPG2 tags don't have this problem. If I pick a large size, so that they display a resized image, the watermark is there with the WPG2 tagged image. I think it's because the WPG2 tag is using the ImageBlock module, which is making sure the watermark is applied, but the HTML generated by G2Image is linking directly to the image.

I'd think the direct link would still generate the watermark, but it obviously doesn't. I need to do some research on how/when the watermarks are getting applied.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Mon, 2007-10-29 14:37

Hi Kirk,

thank you and please let me know....

Best regards
Yogie

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-29 15:05

Ok. I know the cause. It's because G2Image is using the G2 Item ID, instead of the "Preferred Derivative." So, it's using the actual original image, instead of the derivative image with the watermark applied. My bad. Now to figure out a patch...

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-29 15:25

In g2image/g2image.php, replace the following line (around line 235)

			$item_info['fullsize_img'] = $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $item->getid()), array('forceFullUrl' => true));

with the following

			list ($error, $preferred) = GalleryCoreApi::fetchPreferredsByItemIds(array($item_id));
			if(!$error) {
				if (!empty($preferred[$item_id])) {
					$item_info['fullsize_img'] = $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $preferred[$item_id]->getid()), array('forceFullUrl' => true));
				}
				else {
					$item_info['fullsize_img'] = $urlGenerator->generateUrl(array('view' => 'core.DownloadItem', 'itemId' => $item->getid()), array('forceFullUrl' => true));
				}
			}
			else {
				print T_('Error loading preferred image');
			}

That will force G2Image to use the URL for the watermarked image instead of the un-watermarked original.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2007-10-29 21:24

Kirk,

Nice pickup, drop that into SVN and I will add the fix for the Gallery2 Frames issue in Gallery2 2.3 and we can bundle it up into 3.03
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-29 22:04
ozgreg wrote:
...drop that into SVN and I will add the fix for the Gallery2 Frames issue in Gallery2 2.3 and we can bundle it up into 3.03

wpg2next.com's SVN and my dev box already have some G2Image 3.1 work that I'm not sure of from a final functionality and stability point of view. So, I'll drop it into g2image.php on the WP Extend SVN trunk later tonight. I'll Google chat you when it's in.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Wed, 2007-10-31 08:39

Hi Kirk,

I'm very sorry to say that I have replaced the line with the code but still there is no watermark sign...

Any hints more?

Thank you in advance!

Yogie

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-10-31 12:19

Yogie,

You'll have to re-insert the photo. The first link was to the un-watermarked original. If you use G2Image to reinsert it, the link should be to the watermarked derivative.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
yogie.de

Joined: 2007-10-24
Posts: 7
Posted: Thu, 2007-11-01 11:41

Hi Kirk,

yes you're right I did this, but it seems that I inserted the code on the wrong g2image.php file. Now it works as designed many thanks for your help!

Take Care!

Yogie