Coppermine should also allow Video - Page 3 Coppermine should also allow Video - Page 3
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Coppermine should also allow Video

Started by Tarique Sani, October 22, 2003, 10:43:04 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

omniscientdeveloper

Thanks, but I don't drink.  :wink:

For those of you that can code a bit, here are the language file changes that I made:

Add this entry to the "ecard.php" section of your language file:
       'error_not_image' => 'Only images can be sent as an ecard', // Translate 'Only images can be sent as an ecard' to your language.

Add the following changes in the "editpics.php" section of your language file:
'pwidth' => 'width', // Translate 'width' to your language.
'pheight' => 'height', // Translate 'height' to your language.
'pic_info_str_movie' => ' - %s KB - %s views - %s votes', // Translage 'views' and 'votes' to your language.


NOTE: Your language file is found in the 'lang' folder. These changes aren't necessary if you're using English.

This should help out the translators a bit.

STRiDOR

I've just updated my gallery with your mod omniscientdeveloper, and just wanted to say thanks.  It works wonderfully.
STRiDOR

moorey

Excellent work! Trying it out now.

moorey

Sweet.. it works great! Had to disable the watermarking mod though to get it working - a pity but makes sense. I was hoping there was an option to upload a custom thumbnail representation of the particular video, not just file types.

omniscientdeveloper

:) (I've already thought of that.)

Like gaugau said, this is more of a beta release. The final version will have that capability. It'll be accomplished by uploading a pic with "thumb_" as the prefix (or whatever is set in the config) and the extension being either a jpg or png.

Example:

video name: myvideo.wmv
thumb name: thumb_myvideo.jpg or thumb_myvideo.png

(ofcourse coppermine can do the resizing, so the user won't have to do it)

hardlocke

i can't view the thumbs and and the videos doesn't start....
is there a conflict with the watermark hack???


 :?:

omniscientdeveloper

Most likely. See the previous poster. He had to uninstall the watermark mod. I'll download it, when I get some time later this week, and see how it works so I can make them work together.

hardlocke

in my watermark hack, i replaced only one line in functions.inc.php:

original code
return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);

with this code
return 'logo.php?picturename='.$url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);



and here is the logo.php

<?
// SCHIPT BY DJ AXION
// e-mail: DJ@the-expansion.com
// Enjoy this script!

// GET SOURCE PICTURE FROM FORM INPUT
$b = imagecreatefromjpeg($picturename) or die ("Could not create from JPEG");



$bx = imagesx($b); // source width
$by = imagesy($b); // source height


$lm = $b;

if ($bx > 200 and $bx < 600 )  {  // this ensures no watermark is added to small images (e.g. thumbnails)
// ADD WATERMARK (medium Image)
$pos = "bottomright"; //where is the watermark displayed...

if ($pos == "topleft") {
        $src_x = 0;
        $src_y = 0;
        } else if ($pos == "topright") {
        $src_x = $bx - 193;
        $src_y = 0;
        } else if ($pos == "bottomleft") {
        $src_x = 0;
        $src_y = $by - 187;
        } else if ($pos == "bottomright") {
        $src_x = $bx - 105;
        $src_y = $by - 26;
}
// THIS IS THE CODE FOR THE WATERMARK
ImageAlphaBlending($lm, true) or die ("Could not alpha blend"); // Enable when on GD 2+
$logoImage = ImageCreateFromPNG('logo_small.png'); // logo.png is a watermark it add's...
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($lm,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH);
}

if ($bx > 600)  {  // this ensures no watermark is added to small images (e.g. thumbnails)
// ADD WATERMARK (Big Image)
$pos = "bottomright"; //where is the watermark displayed...

if ($pos == "topleft") {
        $src_x = 0;
        $src_y = 0;
        } else if ($pos == "topright") {
        $src_x = $bx - 193;
        $src_y = 0;
        } else if ($pos == "bottomleft") {
        $src_x = 0;
        $src_y = $by - 187;
        } else if ($pos == "bottomright") {
        $src_x = $bx - 580;
        $src_y = $by - 160;
}
// THIS IS THE CODE FOR THE WATERMARK
ImageAlphaBlending($lm, true) or die ("Could not alpha blend"); // Enable when on GD 2+
$logoImage = ImageCreateFromPNG('logo_big.png'); // logo.png is a watermark it add's...
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($lm,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH);
}

Imagejpeg($lm,'',80); //80 means JPEG quality
imageDestroy($lm);
?>

omniscientdeveloper

Which function is the line you replaced in?

hardlocke

i don't know... this code is not from me..... :lol:

omniscientdeveloper

:?

I don't understand. Are you saying that you didn't write that code or that it didn't come from your site?

Joachim Müller

the watermark hack hardlocke is referring to can be found on the old board: http://coppermine.sourceforge.net/oldboard/viewtopic.php?t=961

I wouldn't spend too much time on fixing it: using the watermark hack is not recommended, because it applies the watermark to every pic that is requested from the server (this way, it consumes large server ressources) - can only be used on sites with very little traffic (and a webhost who is very tolerant :wink: ).

Hopefully there'll be an additional feature in coppermine instead in a future version that will batch-add watermarks images (or text) to multiple pics only once (for those who can't/won't apply watermarks on their pc before uploading the pic).

I used to be worried in the first place when the watermark hack was submitted that it'll cause troubles with other mods, as it doesn't use displayimage.php, but uses a separate file (logo.php) which just isn't state-of-the-art any longer (sorry to say that, DJAxion).

GauGau

omniscientdeveloper

It could "possibly" be fixed by caching the watermarked file. From looking at the code, it doesn't look like it does that.

Maybe "wmk_" as a prefix?

Joachim Müller

split unrelated posting into separate thread. Do not hijack other's threads :evil:

GauGau

Tarique Sani

Quote from: "omniscientdeveloper"It could "possibly" be fixed by caching the watermarked file.
Yes caching of watermarked files is the answer and watermarking itself should be an upload time as well as Admin settable option.

This combine with your Picture URL obscuring script has got great potential in Stock Photo (and such) sites which show watermarked pictures to unsubscribed users....
SANIsoft PHP applications for E Biz

salvemeum

I have a problem uploading video files. I tried both the xp publish wizard, and the upload file function in the gallery.
I only get a message that it isnt a picture file. And I get an empty album, with no name on it, so I am not able to delete it, since I dont get any edit, delete ... buttons on it.
It was an wmv file I tried uploading, maybe that is the problem?

salvemeum

Hmm.. Now I tried uploading 2 files to an album.. 2 files that were 2.48 and 2.45 mb... in mpg format, with the mpeg extension to the filenames. The 2.48 mb file uploaded nicely, and worked fine, but the 2.45 mb file I got an
" No picture was uploaded !
If you have really selected a picture to upload, check that the server allows file uploads... !  error... What could cause this? since the files are about the same size + they have the same extension.. non of the files has illigal characters in their name either, one is called mcsplash.mpeg, the other hjelle.mpeg .. strange...

omniscientdeveloper

I never editted the xp_publish file, so I don't know how it works. Post a link. If your site isn't porn I'll check it out.

salvemeum

hehe.. no porn, maybe as far away from porn that you can get :p

http:galleri.flyby-fester.no

and I made a test account
login: testuser
pass: test

salvemeum

hehe.. no porn, maybe as far away from porn that you can get :p

http://galleri.flyby-fester.no

and I made a test account
login: testuser
pass: test