ImageSizingTreeprocessor for putting width and height attrs into images #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I realised I couldn't do height scaling on an image in a table, and discovered that there were some other image handling problems (see Issue 820 and Issue 1116). For my money I would have said that at least being able to set the height rather than the width should be a feature of the core.
I thought for education I would attempt the Treeprocessor for image blocks using fastimage as per the @mojavelinux suggestion.
I took the approach (discussed in the above issues) that aspect ratio must be as per the image sizing and so this Treeprocessor respects the image aspect ratio and doesn't allow it to be changed. There is I guess other reasonable options.
I had difficulty figuring out how to iterate across table cells to deal with block images in asciidoc styled cells. There is quite possibly a better way but it wasn't obvious to me.
Hopefully this is closer to the desired code style as well.