Use this class with images are already on the server

See all posts Reply

Use this class with images are already on the server new!
by Cristian, 10 years, 8 months ago
Hi,
how can I use this class to manipulate images are already on the server?
I don't need the upload process.
Is there a way to adapt this class?

ThanksReply
Re: Use this class with images are already on the server new!
by colin, 10 years, 8 months ago
Just instantiate the class with the local filename. It is all in the docs!Reply
Re: Use this class with images are already on the server new!
by Cristian, 10 years, 8 months ago
Ok, thanksReply
Re: Use this class with images are already on the server new!
by Malinga, 10 years, 5 months ago
Hi,

This is the way which i used to upload local file

$handle= new upload("/home1/ribelzxxx/public_html/apps/xxxx/images/mergePhone.png");

This can be used only one time. After 1 image processing 'mergePhone.png' renamed as 'mergePhone_1.png'.

I used $handle->file_overwrite = true; but it won't.

'mergePhone.png' image is use to every image. It as a main image.

What is the solutions.?Reply
Re: Use this class with images are already on the server new!
by colin, 10 years, 5 months ago
I am not sure what you mean. You instantiate the class with the source file, and then you set the destination file when you call process().

Why do you need to overwrite your source image several times?

In any case, you can still rename your files after a process.Reply
Re: Use this class with images are already on the server new!
by Malinga, 10 years, 5 months ago
@Colin

There is the process.

1. User should upload an image. Then user can see re sized image. (Ajax request)
2. User should select an area from the re sized image. Crop the image according to user's selection.
3. Then create another object. [$handle2->upload('path/to/local/file')] and apply cropped (step 2) image as a water mark
4. Then store in DB (file name only)

I have created 3 image objects ($handle1, $handle2, $handle3) to do this.

The image which on my server is static image. That image should be background image.Cropped image use as a watermark on the my image.

$handle= new upload("/home1/ribelzxxx/public_html/apps/xxxx/images/mergePhone.png");

When calling above statement will be deleted 'mergePhone.png' and renamed as 'mergePhone.png'. i want to keep 'mergePhone.png' in without rename. this image call every image processing.Reply
Re: Use this class with images are already on the server new!
by colin, 10 years, 5 months ago
If I understand properly, you don't want your source image to be deleted, is that right? In that case, don't call $handle->clean() at the end of your process.Reply
Re: Use this class with images are already on the server new!
by Malinga, 10 years, 5 months ago
@Colin

Thank you Colin. It's working properly. Thank you very much for the suggestion.

But, there is a problem. Can i prevent copying as a new image to the server?

MalingaReply