From: JENNIFER I. <ito...@be...> - 2015-08-04 17:24:12
|
Hello! I'm new to reStructuredText and am wondering if there is a way to crop an image/figure. I looked at the docutils directives webpage and found the options for images but do not see anything that would crop an image. Is it not possible or is there a work-around? Any help is appreciated. Thanks! Jen |
From: Guenter M. <mi...@us...> - 2015-08-05 07:57:31
|
On 2015-08-04, JENNIFER ITO wrote: > [-- Type: text/plain, Encoding: --] > Hello! > I'm new to reStructuredText and am wondering if there is a way to crop an > image/figure. I looked at the docutils directives webpage and found the > options for images but do not see anything that would crop an image. Is it > not possible or is there a work-around? Any help is appreciated. This is not supported, you must use an external editor and create a cropped copy. (Is cropping supported by HTML? Otherwise you would need a cropped copy of the image anyway -- at least for HTML output.) You may consider filing an enhancement request or discuss possible implementations first here on the list. Günter |
From: Terry B. <ter...@ya...> - 2015-08-05 14:26:17
|
On Wed, 5 Aug 2015 07:57:10 +0000 (UTC) Guenter Milde <mi...@us...> wrote: > On 2015-08-04, JENNIFER ITO wrote: > > > [-- Type: text/plain, Encoding: --] > > > Hello! > > > I'm new to reStructuredText and am wondering if there is a way to > > crop an image/figure. I looked at the docutils directives webpage > > and found the options for images but do not see anything that would > > crop an image. Is it not possible or is there a work-around? Any > > help is appreciated. > > This is not supported, you must use an external editor and create a > cropped copy. > (Is cropping supported by HTML? Otherwise you would need a cropped > copy of the image anyway -- at least for HTML output.) Images can be cropped in HTML when using them as CSS specified backgrounds for divs etc. Sometime when you look at the resources a page is downloading all its icons are in a strip in one image (saving on network traffic), and it crops them to suit different places on the page. Cheers -Terry > You may consider filing an enhancement request or discuss possible > implementations first here on the list. > > Günter > > > ------------------------------------------------------------------------------ > _______________________________________________ > Docutils-users mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > > Please use "Reply All" to reply to the list. |
From: JENNIFER I. <ito...@be...> - 2015-08-05 15:45:35
|
Thanks for the responses! Unfortunately, I'd like the changes also to occur in the generated pdf as well. I don't think the css file modifications in html carry over, correct? Thanks again! Jen On Wed, Aug 5, 2015 at 7:26 AM, Terry Brown <ter...@ya...> wrote: > On Wed, 5 Aug 2015 07:57:10 +0000 (UTC) > Guenter Milde <mi...@us...> wrote: > > > On 2015-08-04, JENNIFER ITO wrote: > > > > > [-- Type: text/plain, Encoding: --] > > > > > Hello! > > > > > I'm new to reStructuredText and am wondering if there is a way to > > > crop an image/figure. I looked at the docutils directives webpage > > > and found the options for images but do not see anything that would > > > crop an image. Is it not possible or is there a work-around? Any > > > help is appreciated. > > > > This is not supported, you must use an external editor and create a > > cropped copy. > > (Is cropping supported by HTML? Otherwise you would need a cropped > > copy of the image anyway -- at least for HTML output.) > > Images can be cropped in HTML when using them as CSS specified > backgrounds for divs etc. Sometime when you look at the resources a > page is downloading all its icons are in a strip in one image (saving > on network traffic), and it crops them to suit different places on the > page. > > Cheers -Terry > > > You may consider filing an enhancement request or discuss possible > > implementations first here on the list. > > > > Günter > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > Docutils-users mailing list > > Doc...@li... > > https://lists.sourceforge.net/lists/listinfo/docutils-users > > > > Please use "Reply All" to reply to the list. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Docutils-users mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > > Please use "Reply All" to reply to the list. > |
From: Guenter M. <mi...@us...> - 2015-08-06 07:44:58
|
On 2015-08-05, JENNIFER ITO wrote: > [-- Type: text/plain, Encoding: quoted-printable --] > Thanks for the responses! > Unfortunately, I'd like the changes also to occur in the generated pdf as > well. I don't think the css file modifications in html carry over, correct? We have to think about 2 steps: 1. How to achieve image cropping in the various output formats. * Image cropping is supported in LaTeX with options to the \includegraphics command. * There limited support for image cropping in HTML via CSS styling. The ``clip`` CSS property is obsolete and only applicable to absolutely positioned elements, that is elements with ``position:absolute`` or ``position:fixed``. https://developer.mozilla.org/en-US/docs/Web/CSS/clip (Thanks to Alan G Isaac for the link.) The ``clip-path`` CSS property is experimental with very limited browser support. https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path Alternatively, in HTML5 and XHTML, we could insert the image via an inline-SVG wrapper that loads the image and applies a crop-path. http://www.w3.org/TR/2010/WD-html5-20100624/the-map-element.html#svg-0 This is standards-comliable and supported in most current browsers, http://www.w3schools.com/HTML/html5_svg.asp * Support in ODF is also desirable but I don't know the status. 2. How to design a common interface for rst. (I would opt for additional "image" directive options modelled after \includegraphics.) This would make a nice little enhancement project. Günter |