Page 1 of 1

crop with gravity

Posted: 2011-07-28T13:17:51-07:00
by docjones2
I reported this issue in a different thread, but I am moving it to its own thread, to ensure the issue gets attention.

A patch which appeared in today's beta allows gravity to be <set>, however <crop> does not implement gravity at this time.

in msl.c at line 2141, the function ParsePageGeometry is called as opposed to ParseGravityGeometry, which causes gravity to be ignored in rendering the image.

Changing line 2141 to :

Code: Select all

results in proper handling of gravity.

This fix does will only work for the geometry attribute. Supplying attributes height, width, x and y will result in gravity being ignored.

If <crop> was implemented in this way (to ignore gravity) on purpose, it would be a good idea to implement a gravity attribute to work around this design.

If this can be adopted, that would be great. My project requires a <crop> with gravity support, if this is not implemented, I will not be able to use msl for this project. Project requirements dictate that we can not use modified source code.

Thank you!

I will be toying with msl.c to try to get gravity to work with height, width, x and y. If I come up with a good solution, I will post it here.

Re: crop with gravity

Posted: 2011-07-29T14:55:15-07:00
by docjones2
There has been no response to this thread.

Can somebody tell me the status?

If this request reflects a misunderstanding on my part, can someone explain to me the proper way to achieve a `convert file -gravity Center -crop 250x250+0+0` using msl?

Thank you.