Coppermine should also allow Video - Page 2 Coppermine should also allow Video - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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.

Tarique Sani

SANIsoft PHP applications for E Biz

omniscientdeveloper

It seems the key file in all of this is the db_input.php file. Line (263) being the beginning of the problems. There should be a file extension check there to keep it from falling into the trap on (273). I tried to comment out (273-275) but it got caught on (281)....close but no cigar. Anyway, since it seems to be a go for this, I should have an alpha for this by the weekend....hopefully.

omniscientdeveloper

Dudes!!!

I think I did it! I haven't had a chance to test the code yet, because I typed it all at work. (Shhh. Don't tell anyone.)

Here are the files that I've modified so far:

db_input.php (1 function added; modifed rest of code to use function; and changed the order of some if statements)

functions.inc.php (added 7 functions; modified code to use functions)

init.inc.php (added 3 arrays for file types; constants for browser types; and modified code)


I have yet to modify the following:

editpics.php
thumbnails.php
index.php

...and probably a few more, but these are the ones that I figure do the most of the work. (anything else I should be looking at....I'll figure it out anyway, once I get back to my computer.)


Since I'm not that good of an artist, can someone make the three images that will function as the thumbnails for the files when they can't be embeded? I figure the images should be about 320x240, so they can be scaled down if needed. Here are the new types: movie, document (as in pdf or txt), and audio.


One more thing: Is it ok for me to modify it, so if an GD/Imagemagick isn't present, it'll just squeeze/inflate the image using height/width parameters?


Once complete, it should be able to accept anything from txt files to avis....Sorry, no zip support....although, it'll be easier to add it now.

Joachim Müller

Quote from: "omniscientdeveloper"One more thing: Is it ok for me to modify it, so if an GD/Imagemagick isn't present, it'll just squeeze/inflate the image using height/width parameters?
Since either GD or Image Magick is minimum requirement to run Coppermine I'd say "go": if someone's foolsih enough to run Coppermine just to be able to have video files without fullfilling the min requirements (not having GD/IM)  he/she deserves to be "punished" with scaled down full-sized pics :wink:

GauGau

omniscientdeveloper

I have a question.

Would you guys be opposed to storing the files in the database? It's possible to have it work both ways for backward compatibilty. I know it'll pose a performance penalty, but in the long run, it'll make it more flexible....OR it could use unique file names which are stored in the database.

Let me know, and I'll code a patch for it. (I'm using coppermine for two projects that I'm doing, that's why I'm making all these changes.)

Joachim Müller

you mean storing the files themselves as blobs in the database? I don't favor this option, because databases can become too big to handle (especially do backups over http) when using blobs, especially when it comes to (potentially large) video files. I'd favor having only the links/paths inside the db (same as with pics).

GauGau

omniscientdeveloper

OK...No problem. I just want to make sure that I do something that could get used.

So....unique file names stored in the database is a go? What do you think about... http://forum.coppermine-gallery.net/index.php?topic=3069

Here are a couple things I'm considering:

#1
I haven't modified the db structure yet, but I was thinking that there should be a field for the mime type of the file so it  wouldn't have to keep checking. That can be intergrated into the init.inc.php file so it can add it if it isn't there. It would then have to scan the db and all the files to insert the mime type. (This would require a PHP 4.3 installation to work with videos, etc.)


#2
Putting all configs in the db except for username and password info for the db.

#3
Seperating the functions.inc.php file so that functions that are normally used together are in one file and the core ones are in a (core.functions.inc.php???) file. (I think this'll speed it up some.)

moorey

I must this progress looks very promising - waiting in anticipation for this one.

hyperion

The document idea is particularly nice. I would never have thought of it, but I can already imagine some excellent applications.

Quote from: "omniscientdeveloper"#2
Putting all configs in the db except for username and password info for the db.

Could you clarify? Are you proposing to move the database server name, database name, and table prefix into the database itself?
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

omniscientdeveloper

No...basically I was talking about the config variables that are in the init.inc.php file. The ones in the config.inc.php file are fine.

I think it'd be horror to try to put all those different types in one album, though it'll be possible. I think it'd look much cleaner having a document album, movie album, etc. (I started to program it this way, but figured that I'd be microsofting people into my way of thinking.)

omniscientdeveloper

I just setup a demo site with the changes that I've made.
It's about 90% complete, so I should be done really soon. It's still a tad bit buggy, since I have about three more pages to edit.

Here's the site:

{edit: site deleted}



The document types are not viewable yet.

I tested it in IE 6.1. If some of you guys, that have other browsers, can tell me if it looks ok for you, that'd be sweet.

Joachim Müller

looks great - I'm looking forward to the upload facility and the other "backend" functions :wink:

GauGau

omniscientdeveloper

I'm about 95% done now. I was out all day today....church, so I only got about 1 1/2 hours of coding done. I just have the batch upload and ecard parts to do now, so I'll be done tomorrow. :)

I downloaded some icons from deviantart.com. I'm supposing that they're freeware, but I'll ask the author anyway. I use these to display the file types.

I uploaded the changes to the my test site again, so you can check out the changes. I'm still having problems with the document types though. I think I'm going to just make those links open in a new window for any view other than thumbnail.

I may also make the user manually type in the dimensions of the video files, so they get rendered correctly.

...Oh...Everything but the images look like crap in NN 7.1.   :cry:

salvemeum

Looking forward to this :) If it works.. :)
I have been using cpg for some time now, and I love it, but I have always missed to be able to upload small video files and so on. Most digital cameras have a video function, and the clips arent much bigger than the pics taken with the same camera, so the ability to share those small clips along with the pics is a must I think. So I am trembling inmy pants here, and hoping you will get it to work 100%, or 95% sounds good to me aswell :)

omniscientdeveloper

Finished!!!

I used the release version.

Notice: The menus still look the same as before, so to upload a video, etc., you just click the "upload picture" link or use the batch add mode.

WARNINGS:
1. If you have any mods installed, you may have to reinstall them.
2. MAKE SURE YOU BACKUP YOUR CURRENT FILES BEFORE INSTALLING (ESPECIALLY IF YOU HAVE MODS INSTALLED)!!!!!!
3. It's still buggy in netscape navigator when viewing movies.
4. Be careful of the file names. It can throw faulty "file type" errors.

5. These installation files may only work with ENGLISH because of changes to the english language file. If you're setup with a different language, then you may want to ask the translator for your language to update the language file.  You can install it, however, but you may have problems with the editpics.php page.


INSTRUCTIONS FOR USE:
If you upload a movie, especially quicktime, make sure you enter the width and height of the video. (I have yet to add support for REAL video formats.)


MODIFICATION INSTRUCTION:
The file types are hard-coded into the init.inc.php file. If you want to add a new file type (you'll have to do this if you get file type errors) you can add it to one of the arrays there. I think it's pretty complete though.


Once installed, you should be able to add extra file types.

omniscientdeveloper


Joachim Müller

I had only a rough look over it, but I'm very impressed!
I packaged this up for the download section into two packages:
  • cpg1.2.1_mod_video_hack.zip
    as provided by omniscientdeveloper with only the files that were changed (meant for an upgrade of an existing coppermine1.2.1 install)
  • cpg1.2.1_mod_video_full.zip
    a full installation package of cpg1.2.1 with the hack included[/list:u]Please note: this mod hasn't been tested intensively on various platforms, there will surely be some issues to be ironed out - that's why I'd label this *beta*-software! Do not use it on live/production sites! Use it at your own risk. Backup your files before applying the mod!

    This great mod will almost certainly go into the next release... :D  :D  :D

    GauGau

Tarique Sani

Bravo!!! Three cheers for omniscientdeveloper

Great work!!

Folks please download and test as throughly as possible (I am doing it as well) so that we can integrate it in the next release
SANIsoft PHP applications for E Biz

salvemeum

hmmm.. I tried uploading both an avi file, and a mpg file to my gallery.. It shows a "thumb" that says there is a mpeg file there, but when I click it, I only get a small dot showing.. What did I do wrong? I hava a standard installation, with no modifications of cpg.. *sniff*

salvemeum

nevermind :) Dont know what it was, I copied the cpg files and overwrote the excisting files, and now it works. Maybe there was some file left from my old "Non modded" cpg there... or my cache in the browser or something... But Hurray! it works! :)
This guy who did this deserves a beer, or 20 :)