This topic is locked
[SOLVED]

 multiple resize from same upload

11/7/2014 8:42:28 PM
PHPRunner General questions
S
sawanr author

I need functionality where a user can upload a giant image, and it automatically gets resized in 3 sizes. I know it can create thumbnail, but I also want other sizes to be created from same image.
Is there any way to achieve this?

S
swanside 11/8/2014

You could make a custom view for each size you want. Take a look at a sample I have made here
My link

Sergey Kornilov admin 11/8/2014

You can definitely do that using either your own PHP code or PHPRunner's CreateThumbnail function:

function CreateThumbnail($value, $size, $ext)


$value - content of source image file

$size - new size of image (larger dimension, resized proportionally)

$ext - image extension like PNG or JPG

Functions returns the content of resized image.
So you can load source image file content into $value variable, resize it, then save it back to hard drive under a different name. The main question is how you going to reference it later in your application.

S
sawanr author 11/10/2014

Thanks everyone, it was very helpful.
I think CreateThumbnail function is most helpful in my case.