I’m having this problem with both GIMP (for bitmaps) and Inkscape (for vector drawings), so solutions for either are welcome, as I need both anyway.
Many applications have started to crop user-uploaded avatars or other pictures first to a square (by using the smaller edge length) then to a full-sized circle inlaid that square.
To counter this, before uploading I would like to pad the image (resize and possibly move) so that the entire drawing (i.e. anything not background) is contained within the target area.
Example: starting from…
… resize the outer image (not needed here¹, but do as necessary) so that it fits inside the circle…
… but do not actually add the circle to the image:
So when I upload this, the drawing (here, the text “foo”) is wholly contained in the circle.
The solution must be precise (i.e. no manual mouse-moving and resizing until it fits) and should be automated / batched. For GIMP this includes scripting; for Inkscape (SVG can be assumed) this may even involve XML editing, XSLT, etc. (but having a solution at all will be worthwhile).
① not needed here because I cheated by drawing the circle first and resizing the drawing to fit; ideally, starting from a nōn-square image would also work