vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Social Group and Album Enhancements - Watermark Generator (https://vborg.vbsupport.ru/showthread.php?t=263804)

BadgerDog 05-24-2011 01:47 PM

Quote:

Originally Posted by Disasterpiece (Post 2199452)
Looks good to me.

I updated the test script yesterday so it should be more verbose now. Download it from her: https://vborg.vbsupport.ru/showpost....1&postcount=36
Put it into your root dir and navigate to the script, adding ?i1=*number* to the url where *number* is the id from an image where the watermark should appear.

Ok, done and ran ..... :)

http://www.xxxxxx.com/devforum/testa...s.php?i1=22804

Output ...

Watermark system finished
Script end.


When I run preview or look at attachments, no watermark shows. In preview, I still don't see demo pic.

Regards,
Doug

Disasterpiece 05-24-2011 01:52 PM

In your cache directory, do files appear?
If you download one of those, rename the extension to .jpg (or the according image format) and view them in the windows image viewer, do you see watermarks?

If not, PM me your login credentials and I take a look myself. Very strange.

BadgerDog 05-24-2011 02:06 PM

Quote:

Originally Posted by Disasterpiece (Post 2199459)
In your cache directory, do files appear?
If you download one of those, rename the extension to .jpg (or the according image format) and view them in the windows image viewer, do you see watermarks?

If not, PM me your login credentials and I take a look myself. Very strange.

Nothing in cache...

Downloaded attachment pic and nothing showing anywhere on it...

Regards,
Doug

Update: I just went back to the devforum and checked it again. I have no idea why, but all of a sudden watermarks are displaying on both attachments and in-line attachments. :eek: The "preview" pic still doesn't show, but it's at least working live now, so I guess we can start some real testing. :)

demo7up 05-25-2011 01:16 PM

i dont use id's in my url's

this is the error

Invalid SQL:

SELECT a.contenttypeid
FROM attachment AS a
WHERE a.attachmentid = 2006-I-drive-a-eg-4-door;

MySQL Error : Unknown column 'I' in 'where clause'
Error Number : 1054
Request Date : Wednesday, May 25th 2011 @ 08:14:14 AM
Error Date : Wednesday, May 25th 2011 @ 08:14:14 AM
Script : http://nycjdm.com/testattachments.ph...ve-a-eg-4-door
Referrer :
IP Address : 24.136.115.58
Username : XXX
Classname : XXX
MySQL Version : 5.0.92-community

Disasterpiece 05-25-2011 01:21 PM

Which SEO Addons do you use?
Also: Which vB version do you have?

demo7up 05-25-2011 01:36 PM

i have 4.1.3

Im using VB's Friendly URL's built in feature i have mine set to

Basic Friendly URL's

Disasterpiece 05-25-2011 05:46 PM

Interesting, I'll figure it out!

BadgerDog 05-25-2011 08:54 PM

Some questions and thoughts ... :)

It's obvious that using the cache approach, this mod would cause a duplication of attachments, which isn't a problem for people with large hard disk space available.

However, what I was wondering was, is there an impact on performance that would slow down the forums with the mod having to intercept every attachment being viewed by the user, then save it to the cache, then retrieve it again?

Thanks for any feedback ..

Regards,
Doug

Disasterpiece 05-25-2011 09:12 PM

It's waaaay cheaper reading a cache file from disk than regenerating the image for every viewer.
Re-generating means:
- load attachment from file or database
- check if large enough, etc.
- load watermark file
- apply watermark file
- output

Loading from cache means:
- load cached image file
- output

Hard-disk drives use an internal page cache as well, so it's the best way to gain optimal performance.

For those with limited disk space, I implemented the cache table, which only keeps a fraction of the attachments which have been viewed recently in the cache. This should allow optimal control between performance and disk usage. Of course the worst case then would be, if an user views all attachment images one after another. But then again, it's a server and they're optimized to handle this kind of stuff.

If you have more questions or suggestions about performance and cache behaviour, feel free to ask :)

BadgerDog 05-25-2011 09:38 PM

Quote:

Originally Posted by Disasterpiece (Post 2199970)
If you have more questions or suggestions about performance and cache behaviour, feel free to ask :)

Thanks for the detailed answer .. appreciate it ....that was very helpful ... :up:

I think I might try to move this to the live forums, but I'm a little worried that table didn't get created and added to the database during the install. Should I wait until you've finished your beta testing?

Regards,
Doug

Disasterpiece 05-25-2011 09:44 PM

Quote:

Originally Posted by BadgerDog (Post 2199977)
Thanks for the detailed answer .. appreciate it ....that was very helpful ... :up:

I think I might try to move this to the live forums, but I'm a little worried that table didn't get created and added to the database during the install. Should I wait until you've finished your beta testing?

Regards,
Doug

Right now there isn't anything I'd be able to do to fix this behaviour. It's odd, but not really a reproduceable error/bug on my end. As long as it works afterwards, it may be just a little bug in the installscript which isn't critical, because it just has to run once...

I suggest to install the mod on your live system too, if the same issue occurs, just execute the same SQL queries again and it should work. There's nothing which could break by that. :cool:

AnabolicResourc 05-27-2011 04:30 PM

Can't get this to work, no attachment is showing and the watermark is not showing neither only a red x instead.
In admincp i can see the watermark on the preview picture, although it still says: watermark file not found with a yellow triangle.

Can I pm you with some details to get some help ??

Thanks in advance...

Disasterpiece 05-27-2011 06:20 PM

Quote:

Originally Posted by AnabolicResourc (Post 2200629)
Can I pm you with some details to get some help ??

Sure

BadgerDog 05-28-2011 12:54 PM

I have a slightly special requirement for our site, potentially using this mod ... :)

Would you be interested in some contract work to modify this slightly to meet our needs?

Thanks for your work... appreciated as always ... :up:

Regards,
Doug

Edit: BTW, forgot to mention that I installed this on our "live" 4.1.3 forums and it's working fine. The install there added the plwm table that was missing when we installed it on our devforums. For whatever reason, the table inserted correctly on the "live" forums install, so I didn't have to do the manual SQL thing. So far, is working well .... :up:

Disasterpiece 05-28-2011 01:56 PM

Nice to hear!

You can send me a pm with your requirements, we'll work something out :)

BadgerDog 05-28-2011 06:28 PM

1 Attachment(s)
Quote:

Originally Posted by Disasterpiece (Post 2200888)
Nice to hear!

You can send me a pm with your requirements, we'll work something out :)

Sounds good .... :up:

Update: Been testing on our live system and there are no crashes or show stopper errors, but we are experiencing a pic anomaly that I can't explain.

Look at the two pics attached.

I happened to check a pic and noticed that it had a solid grey bar along the bottom (see left pic) which looked odd to me, since I didn't remember it that way before I installed the watermark mod. I then checked some other pics and some were fine, while others also had the grey bar along the bottom.

So, I went into AdminCP and looked at the options for the mod to see if there was anything obvious there. It looked fine and the watermark was showing, as well as your sample dog pic with it on it. So, I simply hit the submit button, then some activity at the top of the screen occurred, showing some files being handled by the mod.

Now, the surprising thing. I went back and looked at the same pics that had the grey bar and now they had the watermark appearing just fine, as shown in the right pic with the correct watermark in bottom right corner of pic. :eek: :confused:

Since then, I've been monitoring the attachment pics and every once and a while, pics start appearing when selected with the grey bar again. If I repeat the AdminCP process of doing nothing more than hitting the submit button, it fixes the problem with all the pics again.

I can't explain what's happening, or how to fix the problem permanently. Any ideas? :)

By the way, I've also attached the watermark PNG file.

Regards,
Doug

BadgerDog 05-28-2011 06:47 PM

1 Attachment(s)
Another follow up ....

This grey bar thing seems to be happening a lot more ....

I selected a pic from a post that had the bar, which was supposed to be a watermark. I then physically went into the server via FTP and looked at the pic as it's stored in the mod's cache file and it looks fine (see pic below). However, if I look at it through vBulletin's attachment view function it has the grey bar.

So, I went into the mod's Cache Stats function in AdminCP and checked the "yes" box, then ran it. A bunch of processing of files occurred saying "Ok", then it returned to the AdminCP. Upon viewing the pic now through the vBulletin attachment capability, the pic now had the watermark and the grey bar was gone. :confused:

Regards,
Doug

Disasterpiece 05-28-2011 07:15 PM

The grey bar can be explained like this:
If the watermark gets applied and the image saved in the cache, the filesizes differs, because the watermark consumes more file size.
Now, vbulletin queries the file size from the original files and sends them in the HTTP Header so the browser knows how many bytes will be transferred. The Mod modifies this number with the cached file, so the whole image from the cache gets transferred completely. In the earlier development states i forgot this step, so grey bars appeared.
However, it's very odd that you experience grey bars, this shouldn't happen anymore.

Possible explanations are scripts and/or other mods who compress image files or use their own caching methods. Do you use any of those?

Always remember to clear your browser cache while testing the watermark behaviour. STRG+F5 should work as a clean reload.

BadgerDog 05-28-2011 07:29 PM

Quote:

Originally Posted by Disasterpiece (Post 2200998)

Possible explanations are scripts and/or other mods who compress image files or use their own caching methods. Do you use any of those?

Not to my knowledge .... :erm:

Quote:

Originally Posted by Disasterpiece (Post 2200998)
Always remember to clear your browser cache while testing the watermark behaviour. STRG+F5 should work as a clean reload.

Roger that ... :up:

Well, if you have any debug method of testing this for you, I'd be happy to give it a try ...

Until then, I'd better turn off the mod, as members are sending emails about why their pics they uploaded have a grey bar on the bottom. :D

Thanks for your help ... :)

Regards,
Doug

BadgerDog 05-29-2011 09:27 AM

Quote:

Originally Posted by Disasterpiece (Post 2200998)

Possible explanations are scripts and/or other mods who compress image files or use their own caching methods. Do you use any of those?

Follow up ... :)

I was thinking about your question. We do use "Memcache" as a basic Linux add-on, which in-turn uses vbOptimize

It's a great add-on that dramatically speeds up our forums, but I don't know why it would affect your mod, if at all.

Regards,
Doug

BadgerDog 06-01-2011 10:14 PM

Another follow up ... :)

I think I found a pattern with the grey bars, but it doesn't make any sense. It seems to only happen, at least on our site, with pics that are very large when expanded to full size, from their small thumbnail. I don't mean size as in bytes, but rather size as in HxW dimensions.

Regards,
Doug

Disasterpiece 06-02-2011 12:32 AM

Quote:

Originally Posted by BadgerDog (Post 2202499)
Another follow up ... :)

I think I found a pattern with the grey bars, but it doesn't make any sense. It seems to only happen, at least on our site, with pics that are very large when expanded to full size, from their small thumbnail. I don't mean size as in bytes, but rather size as in HxW dimensions.

Regards,
Doug

I couldn't yet find the reason to this behaviour, it seems to be webserver-specific... still working on it.

BadgerDog 06-02-2011 10:06 AM

Quote:

Originally Posted by Disasterpiece (Post 2202527)
... still working on it.

Roger that .. :)

Thanks .. :up:

Regards,
Doug

BadgerDog 06-03-2011 03:09 PM

1 Attachment(s)
Update ... :)

Did so more research and there's definitely a pattern of only grey bars appearing for pics over a certain HxW ...

For example, it seemed to be working fine on recent uploads, then a member just added 3 pics that are 1279px ? 959px, they display fine, however, all three have a grey bar across the bottom.

I noticed that another member immediately afterwards uploaded some pic attachments that were less than 1024x768 and the watermarks show just fine on them ...

Hope that helps debug things ... :up:

Regards,
Doug

Edit: I've added another example that shows how large pics seem to a factor in triggering the grey bar. The pic attached is one a member just uploaded as an attachment and it's 2448px ? 2958px (scaled by vBulletin for internal storage to 532px ? 643px).

demo7up 06-09-2011 02:07 PM

Quote:

Originally Posted by demo7up@gmail.c (Post 2199783)
i dont use id's in my url's

this is the error

Invalid SQL:

SELECT a.contenttypeid
FROM attachment AS a
WHERE a.attachmentid = 2006-I-drive-a-eg-4-door;

MySQL Error : Unknown column 'I' in 'where clause'
Error Number : 1054
Request Date : Wednesday, May 25th 2011 @ 08:14:14 AM
Error Date : Wednesday, May 25th 2011 @ 08:14:14 AM
Script : http://nycjdm.com/testattachments.ph...ve-a-eg-4-door
Referrer :
IP Address : 24.136.115.58
Username : XXX
Classname : XXX
MySQL Version : 5.0.92-community

Did you ever get to work on this issue.. I would really like to use this on my website....?

Disasterpiece 06-09-2011 03:45 PM

1 Attachment(s)
Quote:

Originally Posted by demo7up@gmail.c (Post 2205470)
Did you ever get to work on this issue.. I would really like to use this on my website....?

Working on it right now.

The thing is... The url "http://nycjdm.com/testattachments.php?i1=2006-I-drive-a-eg-4-door" seems to be completely wrong.
Did you enter it by yourself? Because that's not the way it was intended, maybe you misunderstood the parameter?
Or did the script redirect you to this url?

Lets say you browse your album, you should find the id even with seo urls enabled. Check the screenshot where to find it:
Attachment 129906
You'd then enter the id into the test url like this:

http://nycjdm.com/testattachments.php?i1=13

This way, the test script will use the image with id 13 for the testing.

demo7up 06-09-2011 04:00 PM

Quote:

Originally Posted by Disasterpiece (Post 2205485)
Working on it right now.

The thing is... The url "http://nycjdm.com/testattachments.php?i1=2006-I-drive-a-eg-4-door" seems to be completely wrong.
Did you enter it by yourself? Because that's not the way it was intended, maybe you misunderstood the parameter?
Or did the script redirect you to this url?

Lets say you browse your album, you should find the id even with seo urls enabled. Check the screenshot where to find it:
Attachment 129906
You'd then enter the id into the test url like this:

http://nycjdm.com/testattachments.php?i1=13

This way, the test script will use the image with id 13 for the testing.

Okay i understand now.. i redid it and i got this error

Failed @ 114

Disasterpiece 06-09-2011 04:17 PM

Just updated with Version 1.1 which should fix a few problems


Quote:

Okay i understand now.. i redid it and i got this error

Failed @ 114
Open the testattachments.php with a texteditor, search for the line
PHP Code:

if (!$res) die("Failed @ 114"); 

replace it with:
PHP Code:

if ($res === FALSE) die("Failed @ 114"); 

and run again. Then report back if it still fails at the same error.

demo7up 06-09-2011 04:48 PM

working perfectly thanks so much!!!

Disasterpiece 06-09-2011 04:50 PM

You mean the new version works now? or the test script?

wut? :D

demo7up 06-09-2011 04:54 PM

the test script, and the product..

stwan 06-09-2011 05:33 PM

This module only works with attached images?

Disasterpiece 06-09-2011 07:35 PM

Quote:

Originally Posted by stwan (Post 2205526)
This module only works with attached images?

With all image files, which exist physically on the server and are handed over by the vB attachment system.

S3Ponline 06-12-2011 05:52 AM

Quote:

Originally Posted by Disasterpiece (Post 2205569)
With all image files, which exist physically on the server and are handed over by the vB attachment system.

How?s the progress on this going?

Which version of vbulletin are you testing this on?

Nice mod. I look forward to the next update :)

Disasterpiece 06-12-2011 10:50 PM

Quote:

How’s the progress on this going?
The plugin hooks into the vbulletin attachment system, before the attachment image gets displayed.
The mod takes the image data either from database or file system according to your vB config, applies the watermark image, caches the image file for next request and prints the image to the screen.

Quote:

Which version of vbulletin are you testing this on?
Developed from version 4.0.8 to 4.1.3, basically it *should* work for 4.x.x

nocte 06-15-2011 03:13 PM

how about performance? Anyone using this Hack on a big board?

Quote:

caches the image file for next request
where are the images cached?

When will this mod be stable?

Disasterpiece 06-15-2011 03:55 PM

Quote:

Originally Posted by nocte (Post 2208110)
how about performance? Anyone using this Hack on a big board?

This remains to be tested.
The image processing should be quite performant, if you choose a bigger cache size, the images only need to be processed once and can then be viewed 100+ times without the need to re-process them.

Quote:

Originally Posted by nocte (Post 2208110)
where are the images cached?

In the file system, you can specify the cache directory yourself.
Idealy, it should remain outside the httpdocs directory.

Quote:

Originally Posted by nocte (Post 2208110)
When will this mod be stable?

It is marked as "Beta" because people were reporting behaviour I could not reproduce.
If it works for your configuration, you can consider it "stable".
I suggest to test it in a safe environment with the same webserver configuration and see if all works as intended.

edgeyveggie 06-15-2011 07:32 PM

Whoa I just tried this and now none of my images are visible on my site that were in threads? What happened? How do I fix this?

WebConnection 06-16-2011 12:39 PM

Is there a way that we can set in the option to have the watermark in random position between the four corners of the image(Top Left, Top Right, Bottom Left, and Bottom Right)?

Disasterpiece 06-16-2011 02:57 PM

Quote:

Originally Posted by edgeyveggie (Post 2208209)
Whoa I just tried this and now none of my images are visible on my site that were in threads? What happened? How do I fix this?

This is a usual issue if any kind of errors appear.

Do you see the watermark in the adminCP settings page? Or is there no image at all?
Do you see any warning symbols in the product's settings?

You can PM me your forum data so I can take a look myself. I guess it's just a configuration issue.

Quote:

Originally Posted by WebConnection (Post 2208483)
Is there a way that we can set in the option to have the watermark in random position between the four corners of the image(Top Left, Top Right, Bottom Left, and Bottom Right)?

Not right now. Since images are cached, it wouldn't be a very useful functionality IMHO.


All times are GMT. The time now is 08:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01534 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (25)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete