How can I scale images in relative size / percentage ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I scale images in relative size / percentage ?

littlepanda
Hello,

I would like to scale an image as 75% of its original size. This is especially important when I'm further converting to docbook and PDF. There's the "scale" attribute in docbook but it doesn't seem to be used.

Actually I would like to be able to define different scales depending on the output format. For example, the original scale is fine for HTML5 output but should be 75% or absolute size for PDF output. Is that possible?

Thanks again.
Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

asotobu
Hi,

here you can find something very similar of what you are looking for:

http://asciidoctor.org/docs/user-manual/#summary-7

I think that for HTML you can only use pixels, not percentage, if it is the case you can open an issue to add support to percentage too.

Alex.

Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

littlepanda
Thank you Alex. "scaledwidth" indeed looks like what I'm looking for.
And for my use case it's perfect that it "only applies to block images rendered to DocBook and then converted to PDF".

However, I do not see how it is rendered to docbook.

I have in my asciidoc file
image::nicePicture.png[Whatever, scaledwidth="25%"]

And in the docbook xml I have the following without any mentioning of scaledwidth ...
<figure>
  <mediaobject>
    <imageobject>
      <imagedata fileref="nicePicture.png"/>
    </imageobject>
    <textobject><phrase>Whatever</phrase></textobject>
  </mediaobject>
</figure>

Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

mojavelinux
Administrator
Alex and @littlepanda,

That does, indeed, look like what you're asking for. However, it's not implemented yet in Asciidoctor :/ But we can add it for the upcoming release!

https://github.com/asciidoctor/asciidoctor/issues/763

There's an open question about the units in there.

Cheers,

-Dan


On Tue, Oct 29, 2013 at 3:32 PM, littlepanda [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thank you Alex. "scaledwidth" indeed looks like what I'm looking for.
And for my use case it's perfect that it "only applies to block images rendered to DocBook and then converted to PDF".

However, I do not see how it is rendered to docbook.

I have in my asciidoc file
image::nicePicture.png[Whatever, scaledwidth="25%"]

And in the docbook xml I have the following without any mentioning of scaledwidth ...
<figure>
  <mediaobject>
    <imageobject>
      <imagedata fileref="nicePicture.png"/>
    </imageobject>
    <textobject><phrase>Whatever</phrase></textobject>
  </mediaobject>
</figure>




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-can-I-scale-images-in-relative-size-percentage-tp902p905.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

littlepanda
@mojavelinux

Woohoo. This is great. Works like a charm. Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

mojavelinux
Administrator

\o/

If you hit other bumps in the road, don't hesitate to post them here or in the issue tracker. We'll keep improving!

-Dan

On Nov 4, 2013 6:36 PM, "littlepanda [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
@mojavelinux

Woohoo. This is great. Works like a charm. Thanks!


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-can-I-scale-images-in-relative-size-percentage-tp902p934.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

Libor Jelinek
In reply to this post by mojavelinux
Hi there!
I ruminate why "scaledwidth" image attribute is not translated into DocBook's "scalefit" by asciidoctor-maven-plugin...

This feature is already marked as fixed in 1.5.0.rc.6+ but it seems that asciidoctor-maven-plugin doesn't track main asciidoctor in step.

What is release policy or when asciidoctor-maven-plugin will include 1.5.0's support for "scaledwidth" image attribute?
Reply | Threaded
Open this post in threaded view
|

Re: How can I scale images in relative size / percentage ?

LightGuardjp
We have to wait for AsciidoctorJ to release. There will be a maven plugin release next week. 

On Saturday, August 16, 2014, Libor Jelinek [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi there!
I ruminate why "scaledwidth" image attribute is not translated into DocBook's "scalefit" by asciidoctor-maven-plugin...

This feature is already marked as fixed in 1.5.0.rc.6+ but it seems that asciidoctor-maven-plugin doesn't track main asciidoctor in step.

What is release policy or when asciidoctor-maven-plugin will include 1.5.0's support for "scaledwidth" image attribute?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-can-I-scale-images-in-relative-size-percentage-tp902p2015.html
To start a new topic under Asciidoctor :: Discussion, email <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;ml-node%2Bs49171n1h37@n6.nabble.com&#39;);" target="_blank">ml-node+s49171n1h37@...
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--