Image resizer plugin v1.0

vistamedia 22 Dec, 2008
Hi everybody,

First of all thanks a million to the developer of this wonderful component. It's really a must have component for web developer like me.
I developed yesterday a nice chronoforms plugin for our French support portal (http://www.joomla.fr).
It's an image resizer for an image upload field. It requires GD library installed on the server. You just have to specify the field of your form where you image is and some other parameters.

Image resizer plugin v1.0 image 1

INSTALLATION:
upload the file in the plugins directory (components/com_chronocontact/plugins)

COMPATIBILITY
Joomla 1.5.x
chronoforms v3.x

FEATURES:
- 1 to 3 images can be generated
- PNG, GIF and JPG support
- you can delete the original file from the chronoforms upload directory
- you can adjust compression rate for the generated images (jpg only)
and for each image individually :
- you can choose the rvb alpha channel (png only)
- you can choose the sizing method: scale or crop
- you can set the dimensions
- the directory where the resized image will be saved
- a prefix for the name

LIMITATIONS
- it actually can generate only 3 images
- it only manage one upload form field.

That’s my small Christmas present for chronoforms users and developers.

Hoping you will enjoy ;-)
Best wishes from south of France for everybody,
Emmanuel.

PS: This plugin is released under GPL🙂
GreyHead 22 Dec, 2008
Hi Emmanuel

Thank you very much.

Happy Xmas

Bob
M4rc0 23 Dec, 2008
Wow!

Very nice plugin!

Thanks for sharing! 😀
Max_admin 23 Dec, 2008
Thanks Emmanuel🙂

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pejot 08 Jan, 2009
Hey i have big problem, when i sent form i get :

Warning: Division by zero in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 347

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 356

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 357

Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 358

Warning: imagealphablending(): supplied argument is not a valid Image resource in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 359

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 361

Warning: unlink(components/com_chronocontact/uploads/FormularzZgl/) [function.unlink]: Operation not permitted in /home/sjo46516/public_html/artfashionjo/components/com_chronocontact/plugins/cf_image_resize.php on line 435

My plugin:
Image resizer plugin v1.0 image 2

Image resizer plugin v1.0 image 3

Image resizer plugin v1.0 image 4

And sometimes sent form do not attach files(photos). Only in email form on my email box i see directory to file but no file why?
GreyHead 08 Jan, 2009
Hi pejot,

The warning messages should disappear if you set Error Reporting to 'System Default', 'Simple' or 'None' in the site Global Configuration (which setting depends on your hosting setup).

I've no idea about the missing attachments. Do uploads work OK without the PlugIn?

Bob

Note: the PlugIn is contributed by a ChronoForms user - I don't think that either Max or I have any idea of the code used.
vistamedia 09 Jan, 2009
Hi,

LIMITATIONS
- it actually can generate only 3 images
- it only manage one upload form field.



This means you can't have 3 coma separated values in the Photo Field parameter but only ONE. Try to just give one and see if it functions(for example file_36).

This plugin was originaly design for an extended registration form with avatar in 3 sizes. That's why you have this limitation. I plan to extend its functionnality in the future but not right now (too much work on a new component).

Emmanuel.
steveg 25 Mar, 2009
Thank you ChronoTeam for a wonderful application (will def donate when I get some funds) and to Emmanuel Danan for this plugin.

Unfortunately I am unable to get this working, even though GD library is installed, folder permissions are 777 and I'm confident the settings are all correct. I'm using the latest version of Chronoforms and email is working, upload & plugin enabled and plugin settings configured.

The upload itself is working fine, with images being deposited to appropriate dir (/components/com_chronocontact/uploads/...) but the plugin is not processing any files and I'm thinking of using a cronjob instead (but I've never done a cronjob before!). Is a cronjob a good idea or is there an easier way? I see that chronoforms does have an option to specify a upload dir but this does not seem to work either (and always uploads files to /components/com_chronocontact/uploads/... no matter what i enter in the Full upload Path: field).

Kind regards
Steve
GreyHead 25 Mar, 2009
Hi Steve,

It's possible that something has changed in the more recent releases that is stopping the plugin working correctly. I don't have time to look now but will add it to the To-Do list. Max has changed the Plugin architecture and we'll be looking at more plugins now to add functionality to ChronoForms tha tmight only be useful to a subset of users.

Bob
steveg 25 Mar, 2009
Hi Bob, Thanks for the fast response! I couldn't work out why nothing was happening - the debug info was fine and so i hope you dont mind if I look at the code. I found that it is possible to change the directory for uploads in the file: /public_html/components/com_chronocontact/chronocontact.php

I replaced the text:

if ( $fileok ) { $uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename);//handle_uploaded_files($original_name, $filename);


with

if ( $fileok ) { $uploadedfile = JFile::upload($original_name,
JPATH_SITE.DS."images".DS."oziogallery".DS.$filename);//handle_uploaded_files($original_name, $filename);



and also

if ( $uploadedfile ) { $attachments[$allowed_s2[0]] = JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename;


with

if ( $uploadedfile ) { $attachments[$allowed_s2[0]] = JPATH_SITE.DS."images".DS."oziogallery".DS.$filename;



and now the uploaded file appears in my root/images/oziogallery/ dir , which means images uploaded using the form appear in the Gallery straight away! I know this is a hack/permanent fix but I'm delighted its working the way i'd imagined it could work😀

My wish list would include adding an option to zip the attachment in to a dir aswell. Good luck with development and all the best. This is a fab extension!
Max_admin 25 Mar, 2009
Hi Steve,

just so I understand, whats the relation between the plugin and the uploads location ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
steveg 02 Apr, 2009
Hi Max,

Sorry, I do not understand your request.
Do you mean the required location for pictures for the Ozio Gallery component i'm using? (it's /images/oziogallery)

The code I changed was JPATH_COMPONENT to JPATH_SITE, so the attachments can be directed to outside of the Chronoforms component directory.

I hope this is of help to you.

Best regards
Steve
Max_admin 02 Apr, 2009
Hi Steve,

no problems, I think I misunderstood your first! thanks for the explanation!🙂

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peers 11 Jun, 2009
does the image resizer work with changing the COMPONENT_PATH to SITE_PATH or is this just to have the image upload to a different folder?
When I change the image path from within the form settings, it works fine uploading to any folder on the site without any hacks.
But does the image resizer work with above change?
Any one have a fix?
GreyHead 13 Jun, 2009
Hi peers,

The Image Resizer plugin was written for an earlier release of ChronoFoms and appears to have the Uploads folder hard-coded at line 379
		$chronouploads 		= "components/com_chronocontact/uploads/".$formname."/";


By all means try changing this to get it to work with site folders.

Bob
peers 26 Jun, 2009
doesnt work when making location the same. maybe theres a chronoforms variable for the file location? seems to be a lot of changes for pluggins (from what can determine by looking at the new ones that ship with chronoforms).
will have to stick with 3.0 for now until find something to work for 3.1
keep up the good work, great component
Max_admin 26 Jun, 2009
Hi peers, the new release about to come out will have an updated version!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger