Skip to content

Commit

Permalink
Add note to Image#crop about removing x- and y-offsets from the page …
Browse files Browse the repository at this point in the history
…attribute after cropping
  • Loading branch information
rmagick committed Dec 18, 2004
1 parent bb66149 commit 2bef0a4
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions doc/image1.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1st September 2004), see www.w3.org" />
"HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />

<title>RMagick: class Image (class and instance methods, part
1)</title>
Expand Down Expand Up @@ -2461,8 +2461,9 @@ <h4>Arguments</h4>
<dl>
<dt>x, y</dt>

<dd>The x- and y-offset of the rectangle relative to the
upper-left corner of the image</dd>
<dd>The <em>x-</em> and <em>y-</em>offset of the
rectangle relative to the upper-left corner of the
image</dd>

<dt>width, height</dt>

Expand Down Expand Up @@ -2546,17 +2547,19 @@ <h4>Arguments</h4>
<dd>A <a href=
"constants.html#GravityType">GravityType</a> constant. If
the argument is NorthEastGravity, EastGravity, or
SouthEastGravity, the x-offset is measured from the right
side of the image. If the argument is SouthEastGravity,
SouthGravity, or SouthWestGravity, the y-offset is
measured from the bottom of the image. All other values
are ignored and the x- and y-offsets are measured from
the upper-left corner of the image.</dd>
SouthEastGravity, the <em>x-</em>offset is measured from
the right side of the image. If the argument is
SouthEastGravity, SouthGravity, or SouthWestGravity, the
<em>y-</em>offset is measured from the bottom of the
image. All other values are ignored and the <em>x-</em>
and <em>y-</em>offsets are measured from the upper-left
corner of the image.</dd>

<dt>x, y</dt>

<dd>The x- and y-offset of the rectangle from the sides
specified by the <em>gravity</em> argument.</dd>
<dd>The <em>x-</em> and <em>y-</em>offset of the
rectangle from the sides specified by the
<em>gravity</em> argument.</dd>

<dt>width, height</dt>

Expand Down Expand Up @@ -2590,6 +2593,23 @@ <h4>Example 2</h4>
<h4>See also</h4><a href="#crop_bang">crop!</a>, <a href=
"#chop">chop</a>

<h4>Notes</h4>

<p>In very recent versions of ImageMagick (6.1.x and later) the
image retains the <em>x-</em> and <em>y-</em>offsets in its
<a href="imageattrs.html#page">page</a> attribute after
cropping. This may cause the cropped image to be displayed by
external viewers (the GIMP, for example) with invisible left
and top borders. You can set the <em>x-</em> and
<em>y-</em>offsets to 0 by changing the <code>page</code>
attribute to a new <a href=
"struct.html#Rectangle">rectangle</a>. For example:</p>
<pre>
img.crop!(x, y, width, height)
img.page = Rectangle.new(width, height, 0, 0)

</pre>

<h4>Magick API</h4>

<p>CropImage</p>
Expand Down

0 comments on commit 2bef0a4

Please sign in to comment.