Forums

Problem with resize action

Tasso 10 Jan, 2016
I have a form to edit data. in this form i have some fields to upload images.
The upload works using as field name the model name of cronoconnectivity, but when i try to use the action to resize image if i use the same name (of model) the action is triggered but the result is:

Array
(
    [quadri] => Array
        (
            [image] => Array
                (
                    [name] => audio-tv-01.jpg
                    [original_name] => audio-tv-01.jpg
                    [path] => /Applications/MAMP/htdocs/admin.quadri/htdocs/images/quadri/originali/audio-tv-01.jpg
                    [size] => 42279
                    [link] => http://localhost:8888/images/quadri/originali/audio-tv-01.jpg
                )

            [thumb_big] => .
            [thumb_med] => .
            [thumb_small] => .
        )

)
and before this php error and warning:

Notice: Undefined index: name in /Applications/MAMP/htdocs/admin.quadri/htdocs/administrator/components/com_chronoforms5/chronoforms/actions/image_resize/image_resize.php on line 93

Notice: Undefined index: path in /Applications/MAMP/htdocs/admin.quadri/htdocs/administrator/components/com_chronoforms5/chronoforms/actions/image_resize/image_resize.php on line 94

Notice: Undefined index: extension in /Applications/MAMP/htdocs/admin.quadri/htdocs/administrator/components/com_chronoforms5/chronoforms/actions/image_resize/image_resize.php on line 128

Notice: Undefined index: extension in /Applications/MAMP/htdocs/admin.quadri/htdocs/administrator/components/com_chronoforms5/chronoforms/actions/image_resize/image_resize.php on line 128

Warning: getimagesize(): Filename cannot be empty in /Applications/MAMP/htdocs/admin.quadri/htdocs/administrator/components/com_chronoforms5/chronoforms/actions/image_resize/image_resize.php on line 238

probably because the action don'tfind the file.

Any idea ?
GreyHead 11 Jan, 2016
Hi Tasso,

Is the Files Upload action before the Image Resize action?

Dos the form work on it's own from the View Form link in the Forms Manager?

Bob
Tasso 11 Jan, 2016
the upload file action is before and the upload works.
The form give the same problem also from the link.
GreyHead 11 Jan, 2016
Hi Tasso,

Thank you, Do you have image.quadri in the Image field name box of the Image Resize action?

Bob
Tasso 11 Jan, 2016
the error is because i have only quadri in the name of image resize. but if i use quadri.image or image.quadri i have no error but the action in not triggered
Tasso 11 Jan, 2016
sorry, maybe is more clear. i have 10 upload fields and each is called image, image_1, ecc. Because is an edit form i use the model name from cronoconnectivity: quadri (is the name of the model) and each filed is quadri[image], quadri[image_1], ecc.
in the upload action i use only the model name (quadri) and the upload works correctly, but after image resize is triggerend only if i use quadri but give error.
GreyHead 11 Jan, 2016
Hi Tassi,

Thank you - it looks as though the Image Resize action doesn't work with Model IDs. You can possibly get round this with Custom Code actions before and after it.

If you add this in a Custom Code action before the Image Resize
<?php
$form->data['temp_image'] = $form->data['quadri']['image'];
?>
Then put temp_image in the Image Resize action and add a Debugger after it does that work? There will need to be a second Custom Code action to rename the results - the Debugger should show what needs to be done.

Bob
Tasso 11 Jan, 2016
tried, but the image resize is not triggered.
Tasso 12 Jan, 2016
Itry everything but the image resize is not triggered. Any idea ? can i send the form ?
This topic is locked and no more replies can be posted.