Script to upload pictures from console Script to upload pictures from console
 

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

Script to upload pictures from console

Started by JensBman, December 07, 2004, 01:10:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JensBman

Hi! I have searched and briefly looked through those topics I believed could contain this question but haven't found any, hang me if Im wrong  ;)

I have been using Coppermine for a couple of weeks and Im almost satisfyed. My only problem (so far?) is that I takes so long to upload pictures. Its only a 400 MHz, 64 MB RAM-machine. This makes my webbrowser (IE) to timeout after just 2-4 pictures in 2048x1536px. (Im using the add several objects uploaded from ftp-feature)

I would love to have a script that I can run from console, that I just start and let it be and when I check back later it's done.

Its my server so I can do like everything on it. I guess it can be some problems for others that don't have administrator-access to their server. Maybe I should tell that I run Gentoo Linux on it.

I have been figuring on building it on my own but I'm not skilled enough in programming/php/mysql to do it.

I really hope there comes a script like this.

Best regards
/Jenz

Tranz

I'm not sure I understand the problem. If you are using your own machine, are you using FTP to place the files or do you just copy them over? Do you have trouble when "uploading" or when adding the files to the albums?

I think dealing with files that size would bog down even more powerful computers. I think you would need to change your php settings to handle longer timeouts.

JensBman

Thanks for taking your time.

I use ftp to put the files in /home/www/gallery/albums/ in a a dir like dhw04 (Dreamhack Winter 2004). Then I use the upload several objects at the same time (or what it is called) to choose this dir (dhw04) and place them in the right album.

Now cpg needs to convert them (right?) and put them in the databse so it knows that the pictures exists. This is whats taking so long. I really don't have any problem with it taking so long, just that I have to refresh every 5 minutes or what it takes. What I would like to have is a script that I can start from console (so I don't have to have the workstation running) that converts and inserts the pictures.

Maybe I can change a variable in php-conifg so the timeout is delayed, but when I uploaded 100 pictures this evening it took 2 hours, and is it really recommended to put the php-timeout that long?

Do you understand my problem/request or do I need to explain further?


kegobeer

Your problem is caused by the image conversion package you are using, not by Coppermine adding a small amount of text to the database.  Creating thumbnails and intermediate images from large original images (both dimensions and filesize) eats up a tremendous amount of resources.  Quite frankly, your home server doesn't have the muscle to handle what you want it to.  There isn't a script that will make your server perform better.

Sorry, the only thing I can recommend is for you to resize your images to a smaller size (like 640x480) before uploading them to your server.  No feature request here that I can see.  Moving to a more appropriate board.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

JensBman

Well, I know that its not particulary Coppermine that is converting the pictures, but its coppermine that is sending the command. And Im not after a script to make my server perform any better, Im after a script that can upload pictures from console, which will eliminate this constant refreshing in my browser.

Im not skilled enough on either php/mysql/programming to make such script, even though I have access to the source-code for coppermine.

Maybe you don't want to help me, if so I have to go to ImageQuick or GD to get a script so I have to convert the pictures before I upload them, which is a rather big convenience so I have to change gallery.  Sorry, no offence. But do you understand my request?

Nibbler

If it is your server, surely you can adjust the timeout to be long enough to upload ?

JensBman

Yes, I guess I can. But can you change the timeout for just that script or do I have to make a change that effects the whole server? Cause in that case Im not willing to do it. As I wrote in my last post it took about 2 hours to upload 100 pictures. And I ask again, is it really recommended to have a script timeout of 2-3 hours?

Joachim Müller

of course timeouts of several hours are absolutely silly to have. After all you're running very, very outdated hardware, you can't expect top performance. Image manipulation is a very resources consuming thing - that's simply it. Like it or not, the only solution that applies to you is to resize on your client before uploading, as suggested before. There's no point in further discussing this. You could as well try to discuss with Ford why the Ford-T (built in the 1930s afaik) isn't capable of winning a Formula One race anymore.

Joachim

Tranz

That's a good analogy. And for comparison, my one-year old Pocket PC has better specs. Time to upgrade? You would save time not waiting around for your computer to do things... and time is money.

JensBman

And upgrade costs money.

Im not in a hurry, and I know its a slow computer, but is fullfill my needs. Im already checking into how to limit the amount of resources that the convert-program can use. My only problem is this timeout, and as GauGau said, its silly to have hours of timeout.

I used Gallery earlier and did not have this problem. It dit everything without timeout. I don't know what differs but obiously they have something that Coppermine has. Well, thanks anyway for trying to help me. Now I just have to find another photogallery that can give me what I want.

/Jenz

Joachim Müller

sure, Gallery was capable of doing this, but coppermine was not...
This is very hard to believe (or nearly impossible), since both apps have in common to use ImageMagick. They both don't resize themselves, but let ImageMagick do the work by handing over just some parameters to ImageMagick. If ImageMagick was able to process your images just fine, then why should it be not capable of processing them under Coppermine? There must be something you do differently. Hardware that is way better than yours can be obtained from ebay for less than $50, so this should not be a problem.

Joachim

P.S. If menalto gallery used to work for you, why are you looking for another app?

JensBman

I know both Gallery and CPG uses ImageMagick but the difference were that Gallery didn't timeout. I don't know if it is something Gallery has in any config or so but that were good cause I could leave it on and do something else.

Why I changed? Well, first I didn't know why it took so long time to upload the pictures so I thought that it maybe were any faster gallery. Now I know there isn't. CPG were recommended by a few friends so I tested it, and I must say, I like it so far, except the timeout.

And about the hardware. Its only the photo-album that requires more resources. Everything else (apache, vsftpd, routing, firewall) is fully satisfied with this. And I don't really have a problem with it taking a couple of hours, as long as I don't have to push the refreshbutton every 5 minutes.

Nibbler

Firefox has an extension that allows you to refresh the page every x mins, bit of a cop-out answer, but it may be useful.

JensBman

Quote from: Nibbler on December 10, 2004, 06:19:43 PM
Firefox has an extension that allows you to refresh the page every x mins, bit of a cop-out answer, but it may be useful.

Hmm, okey, thanks. I'll have that in mind. My brother and I are currently installing openBSD on a more powerful computer to try it as a server.

Thanks for your help guys!