vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Watermark Attached Images (https://vborg.vbsupport.ru/showthread.php?t=53693)

matthepepe 06-03-2003 12:34 AM

I did delete those 2 lines, and it still did not do me any good,

first i deleted

PHP Code:

header("Content-disposition:$attachment filename=$attachmentinfo[filename]");
header("Content-Length: ".strlen($attachmentinfo[filedata])); 

then i replaced,

PHP Code:

if ($extension=="gif") {
  
header("Content-type: image/gif");
} elseif (
$extension=="jpg" or $extension=="jpeg") {
  
header("Content-type: image/pjpeg");
} elseif (
$extension=="png") {
  
header("Content-type: image/png");
} elseif (
$extension=="pdf") {
    
header("Content-type: application/pdf");
} else {
  
header("Content-type: unknown/unknown");
}
echo 
$attachmentinfo[filedata]; 

with

PHP Code:

$isimage true;
switch (
$extension)
{
    case 
"gif":
        
$header "image/gif";
        break;
    case 
"jpg":
    case 
"jpeg":
        
$header "image/jpeg";
        break;
    case 
"png":
        
$header "image/png";
        break;
    case 
"pdf":
        
$header "application/pdf";
        
$isimage false;
        break;
    default:
        
$isimage false;
        
$header "unknown/unknown";
}
header("Content-disposition: inline; filename=" $attachmentinfo['filename']);
header("Content-type: $header");

if (
$isimage)
{
    
// watermark options:
    
$filename "watermark.png"// use a PNG-24 to preserve transparency!

    
$im imagecreatefromstring($attachmentinfo['filedata']);
    
imagealphablending($imtrue);

    
$watermark imagecreatefrompng($filename);

    
$y imagesy($im) - imagesy($watermark);

    
$w imagesx($watermark);
    
$h imagesy($watermark);

    
imagecopy($im$watermark0$y00$w$h);

    
imagejpeg($im""80);
}
else echo 
$attachmentinfo['filename']; 

and i still get the red x's for images.

007 06-03-2003 01:07 AM

Yep, exactly. :( I'm going to try upgrading to 2.3.0 and see how it works then...

S.Shady 06-03-2003 01:10 AM

works fine but none of my attachments of images fully gets uploaded it seams

007 06-03-2003 07:25 PM

Ok I just upgraded to 2.3.0 and still nothing. :(

(Yes I do have GD2 and I have it selected in the options..)

filburt1 06-03-2003 07:27 PM

What exactly happens when you go to an attachment directly?

matthepepe 06-03-2003 07:34 PM

you get a red x.

Courage 06-03-2003 08:49 PM

I have attachments as files hack installed

Instead of

PHP Code:

header("Content-disposition: inline; filename=$attachmentinfo[filename]");
header("Content-Length: ".strlen($attachmentinfo[filedata])); 

I have:

PHP Code:

header("Content-disposition: inline; filename=$attachmentinfo[filename]");
header("Content-Length: $filesize"); // attachments as files hack 

I deleted header("Content-Length: $filesize"); , but I think that now i can add files without size limit checking ...

Ideeas ?

007 06-03-2003 10:09 PM

Yeah I now have 2.3.0 and I still have a red X. I contacted my host again to see if I really do have GD2.0+ and they said I do...

:(

Skyline_GT 06-04-2003 07:08 AM

How come I have this line
Code:

header("Content-disposition: inline; filename=$attachmentinfo[filename]");
instead of
Code:

header("Content-disposition:$attachment filename=$attachmentinfo[filename]");

bitbender 06-04-2003 03:10 PM

Where the heck does a fella FIND a good copy of gd2 for Red Splat ?? I want to use this hack, as well as watermark the pix outa the gallery (photopost), but I can't seem to locate a decent RPM for red splat 7.1 and 7.3.

Any Ideas any one ? All I can find wants tons of pre 6.2 rpm's installed as dependencies..

WEForums 06-04-2003 03:44 PM

I installed it out of curiosity, and this is what I get:

PHP Code:

<br />
<
b>Fatal error</b>:  Call to undefined function:  imagecreatefromstring() in <b>/home2/wef/public_html/forums/attachment.php</bon line <b>89</b><br /> 

Does this, by chance, mean there is no GD2? Still haven't contacted the hosts... :oops:

007 06-04-2003 04:15 PM

Well I got a similar error and I contacted my host again and they said "Oh wait, we don't have GD2... we have GD 1.6 or something.." lol

*sigh* Anyway they are going to upgrade to GD2 and I should be fine then.

Try contacting them. You have nothing to loose by doing so..

WEForums 06-04-2003 04:26 PM

Quote:

Today at 06:15 PM 006 said this in Post #52
Try contacting them. You have nothing to loose by doing so..
Yeah, just got to wait for the owner to get online. He doesn't deal with the forums (I do, obviously) and they are on a separate forum than the site...so got to wait for him to get on.

Doubt we have it since I got that error.

wooolF[RM] 06-05-2003 02:41 PM

]same here... jog works fine... gif = red cross :(
otherwise nice idea :classic:

gmarik 06-09-2003 04:55 PM

Soungs great. You're a real coder.

007 06-11-2003 05:35 AM

If a user attatches a copyrighted image, and my custom watermark is added to it, is this bad? Just wondering because this is an issue that could come up..

:ermm:

Intex 07-11-2003 11:35 AM

Filburt1 - any way this could be adopted to work with Imagemagick?

Highlander 07-15-2003 07:42 AM

and GD 1,6 or 1,8 is not working?

Brandon 07-19-2003 03:54 AM

Quote:

06-01-03 at 07:20 PM filburt1 said this in Post #30
GIF support in PHP is generally horrible. However, I have a solution (which I don't have time to implement but anyone with GD2 experience can):

1. Load the gif using imagecreatefromstring
2. Create a new image via imagecreatetruecolor of the same dimensions
3. Copy the entire gif onto the new image
4. Destroy the original gif

The problem is likely a palette issue.

I know this thread is ungodly old, but I have a question:

How would I go about doing this? I am having the same problem, if someone could explain or give a code for me to add it would be great, I dont have any GD experience :surprised: :cry: Thanks! :)

Brandon 07-20-2003 06:41 AM

*bump* can anyone help? :D

Brandon 07-20-2003 06:42 AM

*bump* can anyone help? :D

sabret00the 08-02-2003 06:28 PM

is there any way to get this so that the watermark scales with the size of the image?

system8 09-04-2003 09:46 AM

I have install it on 2.2.8 Ad it's Work Fine with images

But i find onther proplem is the all other files is broken

when i download and other file like zip or txt it will download it

but i cant open it it's like correbted i open the txt file that i have download it i find inside just the ame of the file test.txt

jdmuniverse 09-05-2003 07:40 AM

Quote:

Yesterday at 06:46 AM system8 said this in Post #63
I have install it on 2.2.8 Ad it's Work Fine with images

But i find onther proplem is the all other files is broken

when i download and other file like zip or txt it will download it

but i cant open it it's like correbted i open the txt file that i have download it i find inside just the ame of the file test.txt

Ah ha! So that's why my other files do that! I was trying to figure out what hack did it and I guess this is it... anyone have a fix for this??

TIA

PAINTBALLM 10-10-2003 10:26 AM

Ok my stats page verifys that I have GD2, however, when I install this hack, images show up with a red X.

glo 10-24-2003 11:32 PM

Hi Paintballm,

I will guess that you have saved the image as CMYK and it need to be RGB! Or your location is incorrect.

Let me know if this helps!

Rampag33 10-25-2003 06:11 AM

Quote:

Originally Posted by PAINTBALLM
Ok my stats page verifys that I have GD2, however, when I install this hack, images show up with a red X.

Proably means that you have the watermark image in the wrong location.

PAINTBALLM 11-03-2003 03:22 AM

will this hack be upgraded to vb3?

joor 11-12-2003 02:39 PM

Installed great and working, I do have a question though, I can't figure out how to make the watermark appear on the bottom right instead of left. Could you offer a bit of code for this? Thanks again for the hack.

*UPDATE* - Was having trouble with other files like PDF's not getting the right header info. I rewrote a few things and it works like I wanted, but I am not having a problem with GD or VB sending the watermark image as code and than refresh and it is an image again, back and forth. So uninstalling for now until I can work this out. 2.3.0 GD2 php 4.3.3

Rampag33 11-13-2003 10:55 PM

Great hacc, installed!

alkatraz 11-22-2003 06:19 PM

awesome hack! working on vb2.28

kuska 12-05-2003 09:25 AM

2.3.0 here.
Nice hack but a problem.
It corrupts every ZIP, MP3, TXT, BMP file thats uploaded.

Any ideas how to fix that?

Skyline_GT 01-02-2004 05:36 AM

hm.. how much it is not working for gif files?

Skyline_GT 01-16-2004 10:49 PM

THis hack does not support 2.3.0 and up..

Gary King 03-19-2004 12:46 PM

Quote:

Originally Posted by Skyline_GT
THis hack does not support 2.3.0 and up..

100%? There have been no filechanges to attachment.php from 2.3.0 all the way to 2.3.4, I'm sure of that. I don't have an archived copy of 2.2.9 or before, though :(

juanchi 12-18-2004 10:14 AM

could someone port this mod to vb 3.0.3, right now there is no working solution for vb 3.0.3, thanks to anyone that can help with this.

y2ksa 04-04-2005 11:57 AM

ignore wrong forum sorry

sabret00the 06-05-2005 03:22 PM

suprised this wasn't stock for vb3

croportal 12-01-2005 12:26 AM

are this hack exist in 3.5 vbulletin version

croportal 12-12-2005 10:17 AM

anonye know 3.5 version


All times are GMT. The time now is 10:27 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.01734 seconds
  • Memory Usage 1,843KB
  • 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_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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