Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Imagizer
#1
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.

[h]Imagizer v 0.2 released![/h]

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)
Code:
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:
[Image: flower.jpg]
+
[Image: settings_1.png]
=
[Image: 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.

[Image: flower.jpg]
+
[Image: settings_2.png]
=
[Image: 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.

[Image: sun.jpg]
+
[Image: settings_3.png]
=
[Image: 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:
[Image: owl.jpg]
+
[Image: settings_4.png]
=
[Image: 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:
[img=uploadify is on]http://web-line-studio.ru/imagizer/uploadify_on.png[/img]
[img=uploadify is off]http://web-line-studio.ru/imagizer/uploadify_off.png[/img]

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

How to determine whether GD2library works?
use this code somewhere on your server:
Code:
<?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)
Reply
#2
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.
Reply
#3
Не работает на GS 3.0 с отключенным uploadify
Reply
#4
@siriusianin

It clearly states that in the description.
My Github Repos: Github
Website: DigiMute
Reply
#5
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 Smile
Pete

Chefbyte Services
Reply
#6
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 Smile

Thanks heaps for developing this plugin.

Stryker
Reply
#7
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 Smile

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); от отпишись если что-то будет не так.
Reply
#8
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 Smile
Reply
#9
Zorato Повторяю. Не работает на GS 3.0 с отключенным uploadify. Файлы до 2Mb ресайзит, от 2Mb и выше переходит на пустую страницу с url /admin/upload.php?path=
Reply
#10
Hi,

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


best regards - alex
Reply
#11
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
Reply
#12
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.
Reply
#13
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.
Reply
#14
can we make thumbnails from the uploaded images ?
We had all been beginners :)
Reply
#15
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.
Reply
#16
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 Wink

auto thumb is needed then we use our own gallery script
in my case this one
We had all been beginners :)
Reply
#17
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 Wink

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 :)
Reply
#18
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 Wink

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...
Reply
#19
Hi Zorato,

As this will in my opinion be an important plugin for this CMS be sure to also add it to extend.
Reply
#20
Zorato Wrote:Ok, I'll add it to todo list for next release...
Thanks ...
We had all been beginners :)
Reply
#21
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
Reply
#22
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 =)
Reply
#23
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!
Reply
#24
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.
Reply
#25
Just wanted to say thanks for creating this excellent plugin - I've been wanting something like this for a long while. Cheers!
Reply




Users browsing this thread: 1 Guest(s)
Free HDTV Channels Residential Solar Panels