eZ Community » Forums » Setup & design » Exact image resizing - custom image...
expandshrink

Exact image resizing - custom image filters with GD

Exact image resizing - custom image filters with GD

Thursday 20 December 2012 5:56:02 pm - 7 replies

Hi,

Have you read this post : http://www.mugo.ca/Blog/Exact-image-resizing-in-eZ-Publish-with-custom-image-filters ? Excellent !

But unfortunately ImageMagick is no installed in my server (for yet)... ! I tried several things but I think it's not possible to create a new cutom image filter for GD in image.ini... Am I wrong ?

Thank you !

Paul

Modified on Thursday 20 December 2012 5:57:37 pm by Paul FROMAGE

Monday 24 December 2012 7:35:53 pm

I could not get what you mean exactly but I am doing all the Crop and Resizing in my image.ini always !

Wednesday 26 December 2012 1:19:39 am

Hi Paul

Have you enabled GD library on your website? by default eZPublish uses ImageMagick library. GD library has some issues with png images.

Saturday 29 December 2012 8:29:59 am

You need set some config details in image.ini.append.php on your  <eZRoot>/settings/override/ folder.

Add following settings for GD [Make Sure GD Library is installed and enabled for PHP]:

[ImageConverterSettings]
ImageConverters[]
ImageConverters[]=GD
 
[GD]
Name=GD
IsEnabled=true
Handler=eZImageGDFactory
 
[ImageMagick]
IsEnabled=false
 
[MIMETypeSettings]
Quality[]
Quality[]=image/jpeg;80
 
[AliasSettings]
AliasList[]=portlet_100x50
AliasList[]=article_240x130
AliasList[]=zoom_570x320
 
[portlet_100x50]
Reference=
Filters[]
Filters[]=geometry/scaledownonly=100
 
[article_240x130]
Reference=
Filters[]
Filters[]=geometry/scaledownonly=240
 
[zoom_570x320]
Reference=
Filters[]
Filters[]=geometry/scaledownonly=570

I hope this would solve your issue.Have fun with eZ Publish.

Thursday 03 January 2013 4:16:32 pm

Hi and thanks for your answers,

The problem is not I don't success to use GD or ImageMagick : I can only use GD on my server and my image.ini files are configured in this way.

What I want to do is resizing my image exactly ( 75*75 ) without deformation, and this in both cases : when the image is wider than it is tall, or when it's taller than it is wide.

With GD we can define aliases with default filters in eZPublish :

  • geometry/scale=x;x
  • geometry/crop=x;x
  • geometry/scaleheight=x
  • ...

In the article from MugoWeb (http://www.mugo.ca/Blog/Exact-image-resizing-in-eZ-Publish-with-custom-image-filters) it is explained this problem of exact scaling and and solution has been found : define a new custom filter nammed geometry/scalemin=x;x

My problem is that the definition of the new filter seems to be possible only with the use of ImageMagick, and not GD... this is the purpose of my post here !

Thanks my advance,

Paul

Monday 18 March 2013 4:46:35 am

The reply has been removed because of violation of forum rules.

Monday 08 April 2013 9:26:47 am

The reply has been removed because of violation of forum rules.

Friday 10 May 2013 8:17:55 am

Hi Fraser

I intend to agree with you... Keeping the SVG as original and have Imagemagick create PNG fallbacks is a charming idea - and it even worked in my hacked local 4.4 installation - at first sight.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from