#186 -filter command line argument ignored

closed-fixed
Core C API (5)
5
2014-07-28
2012-03-30
Anonymous
No

Since 1.3.14 the filter parameter is ignored when resizing images from the command line. Instead the BoxFilter filter is used. Here's the debug output I'm getting:

pozsi@localhost:~/gm$ MAGICK_DEBUG=transform GraphicsMagick-1.3.14/utilities/gm convert original.jpg -filter Cubic -thumbnail 640x360! -quality 95 -crop 640x360+0+0 resized.jpg
15:07:29 0:01 0.000u 29074 resize.c/ResizeImage/1347/Transform:
Resizing image of size 960x540 to 640x360 using Box filter
15:07:29 0:01 0.000u 29074 resize.c/VerticalFilter/1044/Transform:
Enter VerticalFilter() ...
15:07:29 0:01 0.020u 29074 resize.c/VerticalFilter/1243/Transform:
Normal exit VerticalFilter()
15:07:29 0:01 0.020u 29074 resize.c/HorizontalFilter/820/Transform:
Enter HorizontalFilter() ...
15:07:29 0:01 0.030u 29074 resize.c/HorizontalFilter/1016/Transform:
Normal exit HorizontalFilter()

The Box filter is used event if -filter is omitted:

pozsi@localhost:~/gm$ MAGICK_DEBUG=transform GraphicsMagick-1.3.14/utilities/gm convert original.jpg -thumbnail 640x360! -quality 95 -crop 640x360+0+0 resized.jpg
15:28:01 0:01 0.010u 29126 resize.c/ResizeImage/1347/Transform:
Resizing image of size 960x540 to 640x360 using Box filter
15:28:01 0:01 0.010u 29126 resize.c/VerticalFilter/1044/Transform:
Enter VerticalFilter() ...
15:28:01 0:01 0.040u 29126 resize.c/VerticalFilter/1243/Transform:
Normal exit VerticalFilter()
15:28:01 0:01 0.040u 29126 resize.c/HorizontalFilter/820/Transform:
Enter HorizontalFilter() ...
15:28:01 0:01 0.070u 29126 resize.c/HorizontalFilter/1016/Transform:
Normal exit HorizontalFilter()

I think this change is to blame: http://graphicsmagick.hg.sourceforge.net/hgweb/graphicsmagick/graphicsmagick/diff/41dae3dd3710/magick/resize.c
If I recompile after reverting the above filters are handled properly again.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2012-03-30
    • labels: --> Core C API
    • assigned_to: nobody --> bfriesen
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2012-03-30

    The -thumbnail option was supposed to be uing the box filter all along because -thumbnail is supposed to be optimized for speed. Regardless, changing previous behavior is unwarranted as long as the default works as expected. I will fix this.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2012-03-30
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2012-03-30

    Fixed by Mercurial change set fa3b1133d4fa. Thanks for reporting the issue.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks