Minimum Resolution to upload Minimum Resolution to upload
 

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

Minimum Resolution to upload

Started by legend_neo, January 26, 2005, 02:19:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

legend_neo

HI, I hope this time i m not creating a useless thread  :)

i did search the forum and also tried myself  ( u know better now i cant do much of things  :( )  .
The thing is i need to have check on uploading files that has resolution smaller then 800*600 .

Actually i m having a wallpaper website and even guests are allowed to uplaod the pics  but i dont want to have any pic that has less resolution than ( 800 * 600 ).
So the Check is on the Pixels and not on the size , so what i want is When anyone try to upload pic that has less resolution than ( 800 * 600  ) he got an error message. And file never get upload ..

Any Idea  ? ?

Joachim Müller

You can not check before the file has been uploaded - of course it has to exist on the server before such a check could be performed. However, you could add this checking routine right after the file has been uploaded, but before it actually get's added into coppermine's database and the intermediate and thumbs are being created.
This has never been requested before, so there's no mod for this. I won't look into such code, I guess you're on your own with this.

Joachim

legend_neo

Well, i hope this has nothing to do with this
Quote from: GauGau on January 26, 2005, 10:49:44 AM
Why do I have a feeling of "deja vu" when reading your posting... ::)
Joachim
ok, i got ur point that file has to be upload.
I m unable to do what i was thinking but i think there is an otherway to stop it , ie Admin Approval .
But still , i m curious to know , is there any way that resolution of pic could be check right after someone upload it .
Like if a user upload it , the file is uploaded and admin will delete it using "Admin Approval" ( if less than 800*600 ), But the thing is i want to give a message to uploader that his file is Rejected  coz it was below the requirment or something  ... how could i do it  ? 
( i mean the message that says the file is deleted or rejected only if it is below the resolution )
Any help now ?

donnoman

Joachim wasn't saying that it couldn't be done, just that he can't/isn't interested in adding it to his plate.

I've never looked at the code from upload.php, but I do know that somewhere during the upload process a call to GD will return the dimensions of a pic, you could then delete the uploaded file and call cpg_die with your error message.

Of course with multiple uploads you can't just haul off and do a cpg_die, thats where it's going to start getting ugly. You'll also need to take into account xp_publishing, you probably don't need to worry about batch add, unless you don't trust yourself to only upload hires pics.

So it grows into a larger project than just doing a single check.  

Joachim Müller

Quote from: donnoman on January 27, 2005, 07:56:14 AM
So it grows into a larger project than just doing a single check. 
That's why I said I wouldn't do it: for legend_neo, it might be a nice hack. For 99% of all coppermine users, it'll be just useless. The enormous effort to write such a hack just isn't justified. If you (donnoman) or anybody else wants to do it though, I have of course no objections. But, so far we have only seen support and mod requests from legend_neo - how about giving something before you request others to do things you are not capable of? There are many ways in which you can help the project, we can use all sorts contributions and support. Imo it's time for you (neo) to become a giver before you can (again) be a taker.

Joachim

legend_neo

Well thanks for the help .
I will certanly try my best to come up with somethuing that could do it but i do knwo that the chances r rare :)

QuoteImo it's time for you (neo) to become a giver before you can (again) be a taker.
I will love to , but the thig is the only programming language i ever learned is c++ and i m good at it ;)  .. So as i told u before i m just a student. But i will try my level best to contribute something is this excellient project.  ( but that time is not near  ;) )

but anyway Thankxx for ur quick support that u always do 4 me

Joachim Müller

You don't necessarily have to be a coder to contribute to the project. There are several other things we could use: take a look at the thread We need your help

Joachim