MantisBT - Piwigo
View Issue Details
0002672Piwigoimage processingpublic2012.06.30 00:202012.07.02 13:54
plg 
rvelices 
normalminorhave not tried
closedfixed 
2.4.0 
2.4.12.4.1 
any
Apache 1.3.x
0002672: [ImageMagick] invalid option sampling-factor for old versions of ImageMagick
The sampling factor does not work on old versions of ImageMagick, for example 6.2.8 which is still used by many hosting providers (it is the version provided in Debian Etch, current stable - 2)

I propose to comment this option for now, but in the future to be able to detect the ImageMagick version and activate this option only if version > X (I don't which version is X)
No tags attached.
Issue History
2012.06.30 00:20plgNew Issue
2012.06.30 00:20plgStatusnew => assigned
2012.06.30 00:20plgAssigned To => plg
2012.06.30 00:20plgbrowser => any
2012.06.30 00:20plgWeb server => Apache 1.3.x
2012.06.30 00:23svnCheckin
2012.06.30 00:23svnNote Added: 0006397
2012.06.30 00:24svnCheckin
2012.06.30 00:24svnNote Added: 0006398
2012.06.30 06:29rvelicesNote Added: 0006399
2012.06.30 09:55plgNote Added: 0006400
2012.06.30 09:57plgNote Added: 0006401
2012.06.30 21:23svnCheckin
2012.06.30 21:23svnNote Added: 0006402
2012.06.30 21:25rvelicesNote Added: 0006403
2012.06.30 21:54plgNote Added: 0006404
2012.07.01 06:18svnCheckin
2012.07.01 06:18svnNote Added: 0006405
2012.07.02 13:54plgAssigned Toplg => rvelices
2012.07.02 13:54plgStatusassigned => closed
2012.07.02 13:54plgResolutionopen => fixed
2012.07.02 13:54plgFixed in Version => 2.4.1

Notes
(0006397)
svn   
2012.06.30 00:23   
[Subversion] r16210 by plg on branch 2.4

-----[Subversion commit log]----------------------------------------------------
bug 2672: deactivate sampling-factor (for now)
(0006398)
svn   
2012.06.30 00:24   
[Subversion] r16211 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r16210 from branch 2.4 to trunk

bug 2672: deactivate sampling-factor (for now)

(0006399)
rvelices   
2012.06.30 06:29   
if I read the code correctly, when using est imagick, we always call is_ext_imagick() and we launch convert -version
we could save the return value ...
(0006400)
plg   
2012.06.30 09:55   
Yes I agree rvelices, we know the way to retrive the version of "convert". For Piwigo 2.4.1, I would like to increase stability first.

I we store the EXTIM_VERSION in $conf we have to make sure we refresh it very often, in case the user upgrades IM. Maybe it would be better to simply store it in $_SESSION.

We also need to know which version X supports sampling-factor (I don't know).

Then we should only use this option if we know the version and if the version is superior to X.

If you think we can do that we 100% reliability, OK for 2.4.1. Else I prefer to keep it for 2.4.2, when we'll have less problems related to image processing.
(0006401)
plg   
2012.06.30 09:57   
Another easy solution is to add in include/config_defaults:

$conf['imagemagick_sampling'] = false;
(0006402)
svn   
2012.06.30 21:23   
[Subversion] r16230 by rvelices on trunk

-----[Subversion commit log]----------------------------------------------------
bug 2672: invalid option sampling-factor for old versions of ImageMagick (use it for new versions)
(0006403)
rvelices   
2012.06.30 21:25   
plg, ok with my commit ? (no need for session or config. I took 6.6 as a version because it works with 6.6.0-4)
(0006404)
plg   
2012.06.30 21:54   
I've just made a test with convert 6.3.7 and 6.5.7-8 and it also works.

Your test seems very good!

(and I made a visual test with/without sampling-factor and I don't see any difference in quality, but size is indeed lighter)
(0006405)
svn   
2012.07.01 06:18   
[Subversion] r16242 by rvelices on branch 2.4

-----[Subversion commit log]----------------------------------------------------
bug 2672: invalid option sampling-factor for old versions of ImageMagick (use it for new versions) merge from trunk to branch 2.4