sksamuel / scrimage

JVM - Java, Kotlin, Scala image processing library
https://sksamuel.github.io/scrimage
Apache License 2.0
1.07k stars 140 forks source link

resizeTo question #4

Closed liujiuwu closed 11 years ago

liujiuwu commented 11 years ago

I use Thumbnails,it set resize start position(x,y) Thumbnails.of("d:\tmp\rest.jpg") .size(320, 200).sourceRegion(10,40, 320, 200) .outputQuality(1f) .toFile(new File("d:\tmp\rest3.jpg"));

Scrimage i see code Position is not use.

def resizeTo(targetWidth: Int, targetHeight: Int, position: Position = Center): Image = { val target = Image.empty(targetWidth, targetHeight) val g2 = target.awt.getGraphics.asInstanceOf[Graphics2D] g2.drawImage(awt, 0, 0, null) g2.dispose() target }

why?

I want use jcrop user avatar! Thanks!

sksamuel commented 11 years ago

Scrimgage is not Thumbnails - that's a different library. But you're right that position isn't used that's a bug.

sksamuel commented 11 years ago

I've pushed a fix. I'll do a release onto maven later but for now you can build from source and let me know if its ok ?

liujiuwu commented 11 years ago

Sksamuel thanks! I mean is Scrimgage Similar functions of Thumbnails . I can wait pushing scrimage!

sksamuel commented 11 years ago

Released onto maven - usually takes 12 hours to show up.