![]() |
It's been released :)
|
Nice! Now if I can just get the logo to watermark on the SouthEast corner instead of SouthWest...........
|
on the fly cuts off an inch or so of my image.. and on ly shows the top 25% of the watermark logo
|
going to try on upload hack but it looks like it is a little unsucessful as of right now too.
|
hello... hack is working great.
I would like to write the Username of the Poster in the Image but if i use "$bbuserinfo['username']" the username of the user looking at the file is writen there. *G* (so if there is copyright at.... username it prints always the user who is watching it. not very handy. *G). Does anyone know how to get the username who really postet the image? |
it would be related to attachment ID (thinks)
|
Quote:
Same here ... I see only like 25% of the top of the watermark image... Any suggestions someone ???? Palees (SP?) |
I tried this hack, but the image is being cut-off at different places.
What I have been able to test is that by changing the last line of the hack I get different results: (regardless of the watermark being added or not) imagejpeg($im, fetch_attachment_path($posterid, $attachmentid), 100); cuts the image a lot but it displays fast. imagejpeg($im, fetch_attachment_path($posterid, $attachmentid), 90); cuts the image less but it begins to get slow imagejpeg($im, fetch_attachment_path($posterid, $attachmentid), 80); shows the entire image but so slow that it never finishes the page It looks like the hack changes the jpeg and saves it leaving something out of wack. Does anyone has any idea why this is? |
It seems to work ok, until you get to the watermark image on the overlay, then it just stops, only half the watermark loads, when I refresh I get a load of random characters, I have to refresh again but it still doesn't work right ... I'm on VBB 5.0.5
|
because the content-length header doesn't match the output. so the picture gets cut off while you increase the quality.
|
This is a peice of code that needs be altered as it shows above? I'm not too clued up on PHP but understand the basic stuff.
Thanx |
I made a few modifications to the code, as it's not really suitable for later versions of vBulletin 3.0.x. I made some alterations to support 3.0.6, as I'm trying to migrate a bunch of hacks across as part of an upgrade.
First of all, there's some code that spits out the content-length to tell the browser how large the file is. With current hack, the code spits out one content-length, and then an image with a different length. Some browsers get confused with this. So, firstly, back up file you're going to edit!! This has been tested on a single forum, so it might well BREAK your forum if you try it. Then, find the line that states (near the bottom) Code:
header('Content-Length: ' . $attachmentinfo['filesize']); Once again, find the lines that state Code:
echo $attachmentinfo['filedata']; Code:
if ($extension == 'jpg' && !$thumb) { Hopefully Robbban will be able to incorporate some of these changes into an "offical" version - after all, it is his code! |
filesize the $attachpath, but it wouldn't work if your using the database for saving the attachments.
or this, ob_start(); imagejpeg($im, "", 95); header('Content-Length: ' . ob_get_length()); ob_end_flush(); i tried finding a function to find the size of an image resource, but didn't find one. |
I'm not sure that the code you suggest will work, although I haven't tried it. The problem is that the imagejpeg function appears to send the image to the browser.
We can't take the size of the file on the disk/database, as we've made modifications to the image, and hence it's size is different. This code is doing it on the fly, rather than storing it with the watermark in it. |
Quote:
Use sizeof() to get a string length. http://us4.php.net/manual/en/function.sizeof.php |
Quote:
There are alot of articles on image manipulation. All frown on the use of image manipulation on the fly. The bench marks on vBGarage doing image resize on the fly would have made you cringe. We have since changed it. Just a note. |
oh, right, can't use filesize. ob works for me. to think about it, the final output depends on imagejpeg, so there's no other way to get the size (i think). unless you make a temp file...
anyway, it does hurt performance on sites with large collection of images. but the fact that this hack works, an admin option could probably be added to switch on the fly/on upload/ or simply off for watermarking. |
Quote:
PHP Code:
Try that. |
Fantastic stuff - I'm learning here, which is good. I agree, the watermarking is heavy on the processor. Personally, I'd like to keep able to watermark images as they're uploaded. However, that still leaves me with plenty of images already in the system that need watermarking.
|
I've got it working on mine, pretty quickly too, and much better, the full picture loads, I don't know whats different either!
Just one thing, the watermark ends up in the bottom left hand corner, how do I move it to show in the bottom right hand corner? I have a Gallery installed and the watermarks show on the bottom right ... I just want it to look all the same. Thanx! <edit> For whatever reason, on larger images it works fine, on smaller ones, it doesn't load correctly, I've only just discovered this, anyone have any ideas? </edit> |
Code:
$imx = imagesx($im); from here, i think you get the concept. you use the the size of the watermark, and then subtract/add accordingly from the min/max size of the image being watermarked. (from left, x is 0, from right, x is imagesx()) Made correction on $h=... |
Quote:
Check your work. $y is being stepped on or set once uselessly. |
How do you get the watermark on the right? I read the above, but can't make head nor tail of it! Sorry to sound stupid, just confused....
Thanks, the revised code works like a charm! <edit> Sorry for my stupidity, I used the above code and it works perfectly! </edit> |
I have sent Robbban a PM can you please get back to me ASAP.
|
Checked and works for 3.0.7!
|
Quote:
I did exactly what it said but it didnt do anything...and I have the right path to the watermark nvm its working for attachements but not for vbgarage? |
Does anyone have this hack working successfully for 3.0.7? I like to implement on my site
|
After you have installed the hack, add an image attachment.... and submit new thread.... then click on thumbnail in thread for the first time.... does it take a while to upload images on your site? it does on my site.
|
Works just fine here 3.0.7.
Not sure if it loads harder or not. |
Hmm take that back..it dont watermark the pictures all the time...
Just cut them. |
as everyone else has stated. it does work in 3.0.7 large images, cuts off smaller ones and reduces load speed. *uninstalls*
Nice try tho, better than i could do. |
Is anyone aware if this will work on 3.5 - I used this on 3.0.7 and it worked well, just haven't seen it floating around for 3.5 ..... I'm unsure whether to try it in the code or not.
Thanks! Jason |
Quote:
|
it works in 3.5 ( but its in the code and not in a plugin because there is no hook for is)
|
Quote:
|
Quote:
Thanks Jason |
Hi, i wonder if this work for the V.3.0.8 ? thanks alot, nice mod i have been looking 4 :)
|
something like this for 3.5.2 would be great
|
anoyne know how to implement to 3.5.0
thanks |
Does it add the watermark to signature images as well?
|
All times are GMT. The time now is 09:29 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|