Welcome Guest, Not a member yet? Register   Sign In
File upload and image resize all in one
#2

[eluser]Unknown[/eluser]
OK, I solved my problem. Here is the solution for anyone else that may run into something related:
Quote:I imagine I’d need to create a new function in my upload controller to handle resizes
Correct. I created a function within the upload class called image_resize.
Quote:and then somehow call that controller...
I shouldn't have called it a controller... it is an action (a function within the class) and you make use of it from within a different action in the class as follows
Code:
$this->image_resize($the_image)
Quote:Is that the best way to approach it?
I doubt it since I still don't really get this object oriented stuff (things like what path to use to the image gave me headaches) but it works fine.

Oh, the path I used for the image resize
Code:
$config['source_image']
was
Code:
'uploads/'.$the_image
Note the lack of a preceding slash and also note that you don't use a url... use the actual path on your server (that is is the manual but I missed it the first time I read it). I first tried
Code:
'/uploads/'.$the_image
but that only confused me by failing Tongue


Messages In This Thread
File upload and image resize all in one - by El Forum - 02-16-2008, 07:51 PM
File upload and image resize all in one - by El Forum - 02-16-2008, 10:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB