Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ Vips.init()
Vips.run { arena ->
val sourceImage = VImage.newFromFile(
arena,
"sample/src/main/resources/sample_images/rabbit.jpg",
VipsOption.Enum("access", VipsAccess.ACCESS_SEQUENTIAL) // example of an option
"sample/src/main/resources/sample_images/rabbit.jpg"
)
val sourceWidth = sourceImage.width
val sourceHeight = sourceImage.height
Expand All @@ -88,9 +87,9 @@ Vips.run { arena ->
val outputPath = workingDirectory.resolve("rabbit_copy.jpg")
sourceImage.writeToFile(outputPath.absolutePathString())

val thumbnail = sourceImage.thumbnail(
"sample/src/main/resources/sample_images/rabbit.jpg",
400
val thumbnail = sourceImage.thumbnailImage(
400,
VipsOption.Boolean("auto-rotate", true) // example of an option
)
val thumbnailWidth = thumbnail.width
val thumbnailHeight = thumbnail.height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ object VImageCreateThumbnailSample: RunnableSample {
override fun run(arena: Arena, workingDirectory: Path): Result<Unit> {
val sourceImage = VImage.newFromFile(
arena,
"sample/src/main/resources/sample_images/rabbit.jpg",
VipsOption.Enum("access", VipsAccess.ACCESS_SEQUENTIAL)
"sample/src/main/resources/sample_images/rabbit.jpg"
)
val sourceWidth = sourceImage.width
val sourceHeight = sourceImage.height
Expand All @@ -30,9 +29,9 @@ object VImageCreateThumbnailSample: RunnableSample {
val outputPath = workingDirectory.resolve("rabbit_copy.jpg")
sourceImage.writeToFile(outputPath.absolutePathString())

val thumbnail = sourceImage.thumbnail(
"sample/src/main/resources/sample_images/rabbit.jpg",
400
val thumbnail = sourceImage.thumbnailImage(
400,
VipsOption.Boolean("auto-rotate", true) // example of an option
)
val thumbnailWidth = thumbnail.width
val thumbnailHeight = thumbnail.height
Expand Down