通过修补源将自定义参数添加到 imagemagick
我需要修改编码器“标题”的行为以满足我的需要。因此,我需要添加一个名为“maxpointsize”的新参数,它需要一个整数值。
源代码可以在这里下载: imagemagick 6.7.3-3来源。
似乎有一种简单的方法来访问参数,请参阅 coders/caption.c 第 138 或 141 行:
caption=ConstantString(GetImageProperty(image,"caption"));
gravity=GetImageOption(image_info,"gravity");
但我无法将拼图放在一起。我已经尝试过这个,
int maxsize = (int) GetImageProperty(image,"maxpointsize");
但是 make 给了我这个警告,
warning: cast from pointer to integer of different size
任何人都可以看到,我缺少什么吗?
谢谢
i need to modify the behavior of the coder "caption" to fit my needs. Therefore i need to add a new parameter called "maxpointsize" which requires an integervalue.
The source can be downloaded here: imagemagick 6.7.3-3 source.
There seems to be an easy way to access the parameters, see coders/caption.c lines 138 or 141:
caption=ConstantString(GetImageProperty(image,"caption"));
gravity=GetImageOption(image_info,"gravity");
but i cant put the puzzles together. i have tried this
int maxsize = (int) GetImageProperty(image,"maxpointsize");
but a make gives me this warning
warning: cast from pointer to integer of different size
can anyone see, what iam missing?
thankyou
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GetImageProperty
返回一个字符串,类型为const char *
。您需要使用您最喜欢的字符串到整数函数(例如strtol
)将该字符串转换为整数。您当前的代码将无法工作,因为它只是转换而不是转换。GetImageProperty
returns a string, typed asconst char *
. You need to convert that string to an integer using your favourite string to integer function, e.g.strtol
. Your present code will not work since it is merely casting rather than converting.