Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageSizingTreeprocessor for putting width and height attrs into images #80

Closed

Conversation

danyill
Copy link
Contributor

@danyill danyill commented Oct 9, 2017

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.

@danyill
Copy link
Contributor Author

danyill commented Oct 9, 2017

I forgot to reference Issue 1451 where @mojavelinux suggested a TreeProcessor

@danyill
Copy link
Contributor Author

danyill commented Oct 9, 2017

Thinking about this (and asciidoctor/asciidoctor#1116), maybe I did it wrong. If the user specifies the height, should we just proportionately modify the width and only set that to retain responsiveness?

@mojavelinux mojavelinux deleted the branch asciidoctor:master March 4, 2022 11:37
@mojavelinux mojavelinux closed this Mar 4, 2022
@mojavelinux
Copy link
Member

The width is the only attribute that the processor considers. So the width should be computed from the height and passed through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants