PDA

View Full Version : Image Attachment Processor


Axe
02-02-2003, 06:24 AM
Is there a way to process image files (.jpg, .gif, .png) that are attached to posts?

Basically, we're running PhotoPost and all images uploaded to it get tagged by "Hosted by ReptileRap.com" across the bottom of the image (see attached piccy).

Is there a way to get vBulletin to run uploaded images through ImageMagick so I can perform the same process on those?

Xenon
02-19-2003, 01:09 PM
hmm i don't know that ImageMagick

but i think it shouldn't be to hard..

in admin/functions.php this function:
// ###################### Start acceptupload #######################
function acceptupload($moderate=0) {

i think you have to add that parsethrough part here:
if ($extension=="gif" or $extension=="jpg" or $extension=="jpeg" or $extension=="jpe" or $extension=="png" or $extension=="swf") { // Picture file
if ($imginfo=@getimagesize($attachment)) {
if (($maxattachwidth>0 and $imginfo[0]>$maxattachwidth) or ($maxattachheight>0 and $imginfo[1]>$maxattachheight)) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_attachbaddimensions")."\");");
}
if (!$imginfo[2]) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} elseif (1 or !$allowimgsizefailure) {
@unlink($attachment);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}

directly before the last }