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


Messages In This Thread
Imagizer - by Zorato - 2012-02-15, 20:13:57
RE: Imagizer - by bensayers - 2014-09-25, 10:54:34
RE: Imagizer - by Zorato - 2014-10-24, 19:20:53
RE: Imagizer - by Zorato - 2014-10-24, 20:16:51
RE: Imagizer - by bensayers - 2014-10-25, 01:23:29
RE: Imagizer - by Zorato - 2014-10-25, 02:56:46
RE: Imagizer - by bensayers - 2014-10-27, 02:08:35
RE: Imagizer - by pavel9 - 2014-10-18, 22:30:33
RE: Imagizer - by Zorato - 2014-10-24, 20:05:01
RE: Imagizer - by pavel9 - 2014-10-24, 23:03:07
RE: Imagizer - by Zorato - 2014-10-24, 23:27:34
RE: Imagizer - by Zorato - 2014-10-24, 20:13:20
RE: Imagizer - by Zorato - 2014-10-27, 07:47:42
RE: Imagizer - by pavel9 - 2014-10-29, 21:42:38
RE: Imagizer - by pavel9 - 2014-10-30, 01:00:02
RE: Imagizer - by Zorato - 2014-10-30, 06:31:18
RE: Imagizer - by Timbow - 2014-10-31, 22:11:40
RE: Imagizer - by Zorato - 2014-10-31, 22:22:54
RE: Imagizer - by Carlos - 2014-11-25, 04:56:02
RE: Imagizer - by Zorato - 2014-11-25, 05:48:25
RE: Imagizer - by bensayers - 2014-11-25, 05:55:57
RE: Imagizer - by pavel9 - 2014-11-03, 05:06:19
RE: Imagizer - by Rene - 2014-11-21, 22:51:18
RE: Imagizer - by Timbow - 2014-11-25, 05:45:24
RE: Imagizer - by Rene - 2014-11-25, 18:19:48
RE: Imagizer - by Zorato - 2014-11-27, 08:00:41
RE: Imagizer - by AndreaP - 2015-01-14, 20:10:06
RE: Imagizer - by Zorato - 2015-01-15, 18:58:47
RE: Imagizer - by AndreaP - 2015-01-16, 06:19:09
RE: Imagizer - by Zorato - 2015-01-16, 06:29:56
RE: Imagizer - by Shasaar - 2017-08-06, 22:08:11
RE: Imagizer - by Shasaar - 2017-08-09, 05:00:01
RE: Imagizer - by Bigin - 2017-08-09, 15:39:30
RE: Imagizer - by Shasaar - 2017-08-13, 17:40:09
RE: Imagizer - by Shasaar - 2017-08-27, 19:52:42
RE: Imagizer - by hameau - 2017-09-01, 20:58:33
RE: Imagizer - by Shasaar - 2017-09-01, 05:47:26
RE: Imagizer - by hameau - 2017-09-01, 21:01:21
RE: Imagizer - by hameau - 2017-09-02, 00:56:26
RE: Imagizer - by Shasaar - 2017-09-02, 01:46:43
RE: Imagizer - by hameau - 2017-09-02, 02:10:20
RE: Imagizer - by hameau - 2017-09-10, 23:23:19
RE: Imagizer - by Zorato - 2017-09-11, 18:20:49
RE: Imagizer - by hameau - 2017-09-11, 18:31:10
RE: Imagizer - by Carlos - 2017-09-11, 23:52:04
RE: Imagizer - by acenda - 2021-02-25, 20:44:33
RE: Imagizer - by vixrealitum - 2021-03-02, 07:32:30
Imagizer - by stryker - 2012-02-17, 21:34:26
Imagizer - by siriusianin - 2012-02-17, 21:48:54
Imagizer - by n00dles101 - 2012-02-17, 21:51:16
Imagizer - by chefbyte - 2012-02-17, 21:54:33
Imagizer - by stryker - 2012-02-17, 22:06:19
Imagizer - by Zorato - 2012-02-17, 22:31:14
Imagizer - by stryker - 2012-02-17, 22:48:46
Imagizer - by siriusianin - 2012-02-20, 16:51:56
Imagizer - by alexd0001 - 2012-02-29, 19:29:25
RE: Imagizer - by morvy - 2013-11-04, 18:43:06
Imagizer - by Zorato - 2012-03-06, 09:32:53
Imagizer - by Draxeiro - 2012-03-10, 00:43:48
Imagizer - by Zorato - 2012-03-11, 08:27:09
Imagizer - by gugu - 2012-03-11, 10:01:49
Imagizer - by Zorato - 2012-03-11, 20:12:43
Imagizer - by gugu - 2012-03-11, 21:51:39
Imagizer - by gugu - 2012-03-11, 21:53:24
Imagizer - by Zorato - 2012-03-12, 02:01:27
Imagizer - by Draxeiro - 2012-03-15, 18:34:46
Imagizer - by gugu - 2012-03-16, 03:56:30
Imagizer - by AceLine - 2012-04-03, 05:32:16
Imagizer - by Zorato - 2012-04-03, 07:06:06
Imagizer - by AceLine - 2012-04-03, 16:23:54
Imagizer - by Zorato - 2012-04-04, 03:46:25
Imagizer - by Cerulean - 2012-04-28, 12:32:02
Imagizer - by hameau - 2012-04-29, 21:15:37
Imagizer - by jkob - 2012-06-15, 19:07:26
Imagizer - by Rene - 2012-09-18, 22:04:35



Users browsing this thread: 2 Guest(s)