how to use (here is a video)
- activate the add-on. You do this by selecting “Add-ons” on the top menu. Then select “SetImageSize”, then select “show sidebar”. You should now see the sidebar on the right.
- select an image in your document by clicking on the image. The image should be in bmp, gif, jpg or png format. The text flow of the image has to be set to ‘in-line’.
- retrieve the size of the selected image with the “Get size” button in the sidebar on the right.
- change the width & height to your liking. You can set the size in pixels, inches & cm.
- select “Apply” to set the new size.
- use the padlock icon to lock and unlock aspect ratio.
- the 1:1 button retrieves the size of the original image (as stored in the image).
- you can edit your own preferred shortcuts.
limitationThe add on works with bitmap images (bmp, gif, jpg, png) set to ‘inline’ only (because of Google Docs API limitation). When you select an image in Docs you can indicate how the text flows around the image. The options are ‘In line’, ‘Wrap text’ and ‘Break text’; only ‘In line’ will work.
The programming took some getting used to. The scripts that manipulate the document object model actually run on the server and you need to use a call-back mechanism from the HTML in the browser (the sidebar) to the server-side script. Once that was clear the rest was pretty easy. I probably spent more time on the UI than on the server code. The reviewer gave quick and excellent feedback to make the add-on better. Pretty nice experience. Sometimes Google makes some breaking changes to the API (e.g. the security model), then it sometimes takes a bit of time for me to realise what is going on and find the time to fix it.