diff --git a/src/main/java/com/github/fabriciofx/cactoos/pdf/content/Image.java b/src/main/java/com/github/fabriciofx/cactoos/pdf/content/Image.java index ccfd83e..bdc26c0 100644 --- a/src/main/java/com/github/fabriciofx/cactoos/pdf/content/Image.java +++ b/src/main/java/com/github/fabriciofx/cactoos/pdf/content/Image.java @@ -36,7 +36,6 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; -import org.cactoos.Scalar; import org.cactoos.list.ListOf; import org.cactoos.text.FormattedText; import org.cactoos.text.UncheckedText; @@ -77,16 +76,6 @@ public final class Image implements Content { */ private final double posy; - /** - * Width. - */ - private final Scalar width; - - /** - * Height. - */ - private final Scalar height; - /** * Ctor. * @@ -108,40 +97,7 @@ public Image( id, format, posx, - posy, - () -> (double) format.width(), - () -> (double) format.height() - ); - } - - /** - * Ctor. - * - * @param id Id number - * @param format Raw image format - * @param posx Position X - * @param posy Position Y - * @param width Image width - * @param height Image height - * @checkstyle ParameterNumberCheck (10 lines) - */ - public Image( - final Id id, - final Format format, - final double posx, - final double posy, - final double width, - final double height - ) { - this( - id.increment(), - 0, - id, - format, - posx, - posy, - () -> width, - () -> height + posy ); } @@ -150,12 +106,10 @@ public Image( * * @param num Object number * @param generation Generation number - * @param id Id + * @param id Id number * @param format Raw image format * @param posx Position X * @param posy Position Y - * @param width Image width - * @param height Image height * @checkstyle ParameterNumberCheck (10 lines) */ public Image( @@ -164,9 +118,7 @@ public Image( final Id id, final Format format, final double posx, - final double posy, - final Scalar width, - final Scalar height + final double posy ) { this.num = num; this.generation = generation; @@ -174,8 +126,6 @@ public Image( this.fmt = format; this.posx = posx; this.posy = posy; - this.width = width; - this.height = height; } /** @@ -190,10 +140,10 @@ public String name() { @Override public byte[] asStream() throws Exception { return new FormattedText( - "q %.2f 0 0 %.2f %.2f %.2f cm /%s Do Q", + "q %d 0 0 %d %.2f %.2f cm /%s Do Q", Locale.ENGLISH, - this.width.value(), - this.height.value(), + this.fmt.width(), + this.fmt.height(), this.posx, this.posy, this.name() diff --git a/src/test/resources/document/fonts-images.pdf b/src/test/resources/document/fonts-images.pdf index 45a6e88..bdc2059 100644 Binary files a/src/test/resources/document/fonts-images.pdf and b/src/test/resources/document/fonts-images.pdf differ diff --git a/src/test/resources/document/image-jpg.pdf b/src/test/resources/document/image-jpg.pdf index 306dd32..326b58d 100644 Binary files a/src/test/resources/document/image-jpg.pdf and b/src/test/resources/document/image-jpg.pdf differ diff --git a/src/test/resources/document/image-png.pdf b/src/test/resources/document/image-png.pdf index 14e7ccc..9670515 100644 Binary files a/src/test/resources/document/image-png.pdf and b/src/test/resources/document/image-png.pdf differ