1 (edited by Zorato 2012-04-03 13:48:42)

Topic: Imagizer

After I've installed a few copies of GS to my clients, I've noticed that they upload 3MB photos with resolution about 4000x4000 and place 20 photos on 1 page. So I developed plugin, that would handle each uploaded photo by resizing, cropping or compressing it automatically.

Imagizer v 0.2 released!

Changelog:

  • .bmp image support added (beta)

  • settings labels i18n

  • image watermarking

  • image converting to .jpg

  • image file compression

  • all options save aspect ratio: portrait/landscape pictures will remain portrait/landscape

  • some bugs fixes/code refactoring

Requirements:

  • GD2 library - it is a part of PHP core, so it is installed on the most of hosters

A few words about .bmp and compresion.
The GD php library doesn't support .bmp files, so I was forced to use non-core functions, which are not fast enough. Some optimization was made, but still, bmp picture may be loading in up-to 30 seconds, and I don't know what to do about it.
The new compression function also not so precize as it may seem. It tries to check file size and compress it to destination size, but, as I understand, jpeg compression is not easily predictable thing. Anyway, it can be used, and your pictures will be compressed, but don't expect them to be precisely the same size as you set in settings. And again (as it is with .bmp) any advice will be appreciated, because I don't know how to impreve this algorithm at the moment.

Imagizer runs great with GS 3.1, however GS 3.0 version is supported only with uploadify turned off (uncomment line in gsconfig.php file)

define('GSNOUPLOADIFY', 1); 

To-do list:

  • make watermarking more customizable

  • fix bugs, if any

  • optimize/improve .bmp images loading/saving

  • improve .jpeg images compression

  • Thumbnail generation

Settings explanation:

Variable size:
http://web-line-studio.ru/imagizer/flower.jpg
                  +
http://web-line-studio.ru/imagizer/settings_1.png
                  =
http://web-line-studio.ru/imagizer/flower_1.jpg
Explanation: one or more of picture's dimentions was bigger than maximum set in settings. Image was resized to fit maximum size, without changing aspect ratio.

http://web-line-studio.ru/imagizer/flower.jpg
                  +
http://web-line-studio.ru/imagizer/settings_2.png
                  =
http://web-line-studio.ru/imagizer/flower_2.jpg
Explanation: one or more of picture's dimentions was bigger than minimum set in settings. Image was resized to fit minimum size, without changing aspect ratio, but quality may be reduced, due to enlarging small picture.

http://web-line-studio.ru/imagizer/sun.jpg
                  +
http://web-line-studio.ru/imagizer/settings_3.png
                  =
http://web-line-studio.ru/imagizer/sun_1.jpg
Explanation: Picture width was bigger than maximum, but height smaller than minimum. Priority was set to maximum, so picture was resized to fit maximum requirements, without changing aspect ratio.

Exact size:
http://web-line-studio.ru/imagizer/owl.jpg
                  +
http://web-line-studio.ru/imagizer/settings_4.png
                  =
http://web-line-studio.ru/imagizer/owl_1.jpg
Explanation: First, picture was resized to fit height defined in settings. Than, left and right side was cropped to fit dimensions from settings. The algorithm automatically works out to fit width or height and what sides to crop (left and right or top and bottom) to lost lesser image area. Aspect ratio of figures on picture is saved, result picture aspect ratio could be calculated from settings set sizes. In addition, watermark with "TEST" text was added.




F.A.Q.:

How to determine wether uploadify is turned on/off:
uploadify is on
uploadify is off

How to disable Imagizer?
Simply deactivate it in plugins list!

How to determine whether GD2library works?
use this code somewhere on your server:

<?php var_dump(gd_info()); ?>

IMPORTANT
config.xml file in imagizer folder should be writeable, or else your settings won't be saved (thx AceLine)

Post's attachments

imagizer.zip 62.46 kb, 1 downloads since 2012-03-10 

You don't have the permssions to download the attachments of this post.
Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

Hello Zorato,

I was very excited to see this plugin. I know all too well that there are a lot of people that have no idea on the resolution of images as they upload them. It's just a photo that they want to have on their website.

However the plugin doesn't seem to work on my installations of GS 3.0. I even installed a fresh GS 3.0, copied the  imagizer plugin to the plugins folder and uploaded a large file (I ddn't change any other settings at all and uploadify is turned off by default anyway).

The file uploaded at exactly the same resolution as the original (1200 x 1600). I believe the default setting should have cropped it to 500 x 500.

I have treid it on XAMPP and my VPS server. Is there any any setting that needs to get enabled / diabled to make it work. I also hope that you get it to work with 3.1 eventually - Is this something your still working on?

Look forward to your reply.

Stryker.

I think this is going to be one of those necessary plugins that should be loaded with every install. I hope the solution is fairly straight forward.

Re: Imagizer

Не работает на GS 3.0 с отключенным uploadify

Re: Imagizer

@siriusianin

It clearly states that in the description.

Currently working on The Matrix Plugin...

Re: Imagizer

Just installed this and it works fine and to be honest I think it sould be a core install, as it will stop people uploading huge picture files and it may even help speed up the internet for all users, with their pictures trimmed to a managable size :)

Pete

Chefbyte Services

Re: Imagizer

The description reads "it only works on GS3.0 with uploadify turned off". I thought that meant uploadify had to be disabled.

Once I enabled uploadify i(e removed the "#") then all works good. I also agree that it should be part of core program and maybe stick it on the todo list for a future version :)

Thanks heaps for developing this plugin.

Stryker

Re: Imagizer

stryker wrote:

The description reads "it only works on GS3.0 with uploadify turned off". I thought that meant uploadify had to be disabled.

Once I enabled uploadify i(e removed the "#") then all works good. I also agree that it should be part of core program and maybe stick it on the todo list for a future version :)

Thanks heaps for developing this plugin.

Stryker

As I described in description, on GS 3.0 you should uncomment (remove # as you did) line
define('GSNOUPLOADIFY', 1);

It's a pity that it is called in such a way: "gsNOuploadify", this means, defining (removing #) this constant will turn uploadify off.

Plugin was written for GS 3.1 and tested for it, but after tests for GS 3.0 I've decided to release it for GS 3.0 too. So it was working, it works and it will work with GS 3.1.

P.S. @siriusianin разкоментируй строку #define('GSNOUPLOADIFY', 1); от отпишись если что-то будет не так.

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

Thanks Zorato. I feel a bit embarred that I did not read it properly. Can only blame the fact that it's nearly midnight in Australia and I've spent all day with Get Simple.

Great CMS, Great Plugin and Great news that it can work with 3.1 :)

Re: Imagizer

Zorato Повторяю. Не работает на GS 3.0 с отключенным uploadify. Файлы до 2Mb ресайзит, от 2Mb и выше переходит на пустую страницу с url /admin/upload.php?path=

Post's attachments

10.43.39.jpg
10.43.39.jpg 34.86 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

10 (edited by alexd0001 2012-02-29 06:46:36)

Re: Imagizer

Hi,

now when i try to upload files - define('GSNOUPLOADIFY', 1); is active, i got a Server-Error 500 - whats wrong


best regards - alex

Re: Imagizer

alexd0001 wrote:

Hi,

now when i try to upload files - define('GSNOUPLOADIFY', 1); is active, i got a Server-Error 500 - whats wrong


best regards - alex

Sorry for answering so late.
I have no idea about this error, you should probably update your GS version to 3.1 (so that you can easily use uploadify) and re-download this plugin - may be archive was corrupted.

P.S. I'm going to release v 0.2 in couple of days

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

Zorato wrote:

P.S. I'm going to release v 0.2 in couple of days

Hi Zorato,

This plugin is something that was badly needed for GS and as someone mentioned earlier, should basically be a core install.

We too noticed customers sometimes uploading HUGE files and placing them on the page. Basically that's a big no no but you can't expect people to resize photo's before uploading. Computer-savvy people might do so, but the rest just reasons 'I need this photo on my website' and uploads it.

So your plugin will be a very good addition to the arsenal of just about any GS developer. Furthermore so since sooner rather than later everybody will be on 3.1.

However, before I will regularly start using your plugin on our production sites I do have a question, maybe a stupid one at that but it is not totally clear to me yet:

With regards to 'variable size' am I correct in assuming that depending on if the photo is landscape or portrait it will either resize it to the respective set width or height?

Looking forward to your new version, I am curious what additions that will bring.

Re: Imagizer

Thank you all for your feedbacks, I'm glad to announce that Imagizer v0.2 released!
I'm looking for further feedbacks, bug reports, questions, feature requests etc.

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

can we make thumbnails from the uploaded images ?

We had all been beginners :)

Re: Imagizer

gugu wrote:

can we make thumbnails from the uploaded images ?

Thumbnails can be easily made by core GS functionality (with js cropper) and I'm not sure whether auto thumb generation is needed.

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

can it be integrated with same function
that  I18 gallery settings have today...
(Default thumbnail dimensions)
in my case 100x100 and not crop function.
so we have both the large images and a thumbnail ;)

auto thumb is needed then we use our own gallery script
in my case this one

We had all been beginners :)

17 (edited by gugu 2012-03-11 07:54:26)

Re: Imagizer

gugu wrote:

can it be integrated with same function
that  I18 gallery settings have today...
(Default thumbnail dimensions)
in my case 100x100 and not crop function.
so we have both the large images and a thumbnail ;)

auto thumb is needed then we use our own gallery script
in my case this one

@ Zorato thanks for a great plugin

We had all been beginners :)

Re: Imagizer

gugu wrote:

can it be integrated with same function
that  I18 gallery settings have today...
(Default thumbnail dimensions)
in my case 100x100 and not crop function.
so we have both the large images and a thumbnail ;)

auto thumb is needed then we use our own gallery script
in my case this one

Ok, I'll add it to todo list for next release...

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

19 (edited by Draxeiro 2012-03-15 04:35:32)

Re: Imagizer

Hi Zorato,

As this will in my opinion be an important plugin for this CMS be sure to also add it to extend.

Re: Imagizer

Zorato wrote:

Ok, I'll add it to todo list for next release...

Thanks ...

We had all been beginners :)

Re: Imagizer

Hi Zorato, strastwjtje ;o)

I have one problem: I use Imagizer on GS3.1 and it works well. The only problem is, I can't get settings page to work... As I change any settings on settings page and save it, the old settings are back on reloading the page.

Pls. give me a hint on how to solve this issue...

Thnx. in advance and best regards!

AceLine

PS: Spasiba

Re: Imagizer

AceLine wrote:

Hi Zorato, strastwjtje ;o)

I have one problem: I use Imagizer on GS3.1 and it works well. The only problem is, I can't get settings page to work... As I change any settings on settings page and save it, the old settings are back on reloading the page.

Pls. give me a hint on how to solve this issue...

Thnx. in advance and best regards!

AceLine

PS: Spasiba

Privet ;]

Do you mean Imagizer settings page or website settings page?

First, try to disable Imagizer in 'plugins' tab, and make sure everything is ok (that will mean, that it is Imagizer fault, indeed). Then check website health in 'support' tab, maybe you don't have right to write in files.
Another way to make it clear is to enable debug mode, may be you will see some error messages - then we can perform any other actions.

P.S. it is very strange situation, maybe you shouldn't refresh page - the old data is send and applied again.
P.P.S. As an extreme case, you can manualy edit xml files to get needed configuration.

Pozhaluysta =)

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

Dobritjen, Zorato.....

Thnx. for your fast reply... I solved it my self, pls. put this information to your install instructions:

1.) set folder /plugins/Imagizer to 777
2.) set file /plugins/Imagizer/config.xml to 666

Sorry for not thinking first... ;o)

Nice regards to Riga from Austria / Vienna

AceLine

PS: Ja liupiu imagizer!

Re: Imagizer

AceLine wrote:

Dobritjen, Zorato.....

Thnx. for your fast reply... I solved it my self, pls. put this information to your install instructions:

1.) set folder /plugins/Imagizer to 777
2.) set file /plugins/Imagizer/config.xml to 666

Sorry for not thinking first... ;o)

Nice regards to Riga from Austria / Vienna

AceLine

PS: Ja liupiu imagizer!

Thanks for temporary solution, probably will change config file location to a better (and proper) place (data/other) folder with new release.

Just another Get Simple fan
Imagizer plugin
I18N language menu plugin

Re: Imagizer

Just wanted to say thanks for creating this excellent plugin - I've been wanting something like this for a long while. Cheers!