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..


All times are GMT. The time now is 09:30 PM.

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.01072 seconds
  • Memory Usage 1,757KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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