Different approach - I let them upload whatever image size they want (well,
to a reasonable level) and then use a thumbnail.php to resize image on
display...
thumbnail.php?gd=2&src=images/{image_name}&maxw=175
"sweiss" <
sweiss@forum.codecharge> wrote in message
news:5411b4de8b8caa@news.codecharge.com...
> Hi,
>
> i want to validate if a uploaded image has the right width. So i wrote
some
> custome code into the "Before Process File" section:
>
> $the_pic=$form->picture->GetValue();
> $pic_string = "/tmp/".$the_pic;
> $size = GetImageSize ($pic_string,&$info);
> if($size[0] <> 175){
> $pictest->Errors->addError("Please check the picture. Must have a witdh of
175
> pixels!");
> }
>
> The error will be displayed if the width of a file is not 175 pixels but
the
> form will be completely proccessed, Record is written into database and
the
> uploaded file will be moved from "/tmp/ to the picture directory. But this
is
> exactly not what i want. If the error occours nothing should be written
into
> the database.
>
> Where is my error?
>
> Regards
>
> Stefan
> ---------------------------------------
> Sent from YesSoftware forum
>
http://forums.codecharge.com/
>