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

[AsciiDoc conversion] Image scaling #139

Closed
iansk opened this issue Aug 29, 2023 · 2 comments · Fixed by hlxsites/prisma-cloud-docs#68 · May be fixed by #140
Closed

[AsciiDoc conversion] Image scaling #139

iansk opened this issue Aug 29, 2023 · 2 comments · Fixed by hlxsites/prisma-cloud-docs#68 · May be fixed by #140
Assignees

Comments

@iansk
Copy link
Collaborator

iansk commented Aug 29, 2023

Setting the width and height attributes in the AsciiDoctor source has no effect on the size of the image in the HTML output.

AsciiDoctor input:

https://github.com/hlxsites/prisma-cloud-docs/blob/7102ef810abaa445ed92c9c36a017701e356f856/docs/en/compute/pcee/admin-guide/welcome/test-asciidoc.adoc?plain=1#L64-L91

Relevant code:

Test1 - Normal size

image::test1.png[]

Test2 - Scale by width

image::test1.png[width=100]

Test3 - Scale by height

image::test1.png[height=100]

Franklin output:

https://main--prisma-cloud-docs-website--hlxsites.hlx.page/prisma/prisma-cloud/en/compute/pcee/admin-guide/welcome/test-asciidoc?branch=ian/test-asciidoc

Scroll down to the section "Image sizing". Notice that all images are the same size. The second and third images should be scaled down in size.

Reference info:

@maxakuru
Copy link
Contributor

there are 2 parts to this:

  1. setting the values in the conversion, this already worked but I added the default unit of % when one doesn't exist
  2. setting the img width/height in CSS on the client

for 2, this PR will remove the automatic scaling to 100% of possible width: #140

@iansk I'll leave it up to you to decide whether that's something that applies everywhere, the implication being that the images may not fill the entire width of a section/page, and authors should explicitly define them

@iansk iansk changed the title [AsciiDoctor conversion] Image scaling [AsciiDoc conversion] Image scaling Sep 30, 2023
@maxakuru
Copy link
Contributor

maxakuru commented Oct 2, 2023

if this is still an issue please reopen with an example

@maxakuru maxakuru closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants