Re: Resize filters

[email protected] Mon, 23 May 2011 18:51:43 +0000
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
On Mon, May 23, 2011 at 01:21:17PM -0500, Bob Friesenhahn wrote:
> On Mon, 23 May 2011, [email protected] wrote:
>>>
>>> If my memory is correct, the bug was in the Wand library.  It was fixed
>>> in conjunction with other changes.  However, I am not able to find a
>>> record of a change so perhaps my memory is incorrect.
>>
>> I'm using magick api directly.
>>
>>> Regardless, 1.3.5 is an old release and a huge number of bugs have been
>>> fixed since then.
>>
>> Understood, and what I was afraid-of, in a way :)
>
> Quite by coincidence, I happen to be sitting in front of the exact same 
> Ubuntu version you are using.  It seems that the functionality is  
> working for the command line:
>
>  MAGICK_DEBUG=transform /usr/bin/gm convert logo: -filter blackman -resize '20%' null:
> 13:16:05 0:01 0.000u 25775 resize.c/ResizeImage/1281/Transform:
>   Resizing image of size 654x418 to 131x84 using Blackman filter
> 13:16:05 0:01 0.010u 25775 resize.c/VerticalFilter/1006/Transform:
>   Enter VerticalFilter() ...
> 13:16:05 0:01 0.010u 25775 resize.c/VerticalFilter/1177/Transform:
>   Normal exit VerticalFilter()
> 13:16:05 0:01 0.010u 25775 resize.c/HorizontalFilter/809/Transform:
>   Enter HorizontalFilter() ...
> 13:16:05 0:01 0.020u 25775 resize.c/HorizontalFilter/979/Transform:
>   Normal exit HorizontalFilter()
>
> Since it works for the utility, it can clearly work via the API as well 
> since the utility uses the API.
>
> What resize API function are you invoking and what parameters are you  
> passing?


    image2=ResizeImage(imgstruct->image, x, y, filter, 1.0, &exception);

is what I've got currently. I'm experimenting w/ all the resizing
facilities atm and some are working well, others are not (Resize,
Thumbnail cause segfault); I don't know what extra preparation is required
by me.

filter is an int, currently.
imgstruct is my structure to keep an image and it's imageinfo together.
image and image2 are Image*
x, y are ints.

exception is ExceptionInfo, and is initialized by GetExceptionInfo().

Perhaps at this point, you could tell me: what is the relationship
between ImageInfo and Image? I'm keeping them together currently, but in
my (brief) experience so far, it seems ImageInfo is mostly (only?) used
to bootstrap loading an image.

Thanks for your attention Bob,

-bch

> Bob
> -- 
> Bob Friesenhahn
> [email protected], http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

-- 
Brad Harder
Method Logic Digital Consulting
http://methodlogic.net/
http://twitter.com/bcharder


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay