File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
sample/src/main/kotlin/vipsffm/sample Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,7 @@ Vips.init()
7878Vips .run { arena ->
7979 val sourceImage = VImage .newFromFile(
8080 arena,
81- " sample/src/main/resources/sample_images/rabbit.jpg" ,
82- VipsOption .Enum (" access" , VipsAccess .ACCESS_SEQUENTIAL ) // example of an option
81+ " sample/src/main/resources/sample_images/rabbit.jpg"
8382 )
8483 val sourceWidth = sourceImage.width
8584 val sourceHeight = sourceImage.height
@@ -88,9 +87,9 @@ Vips.run { arena ->
8887 val outputPath = workingDirectory.resolve(" rabbit_copy.jpg" )
8988 sourceImage.writeToFile(outputPath.absolutePathString())
9089
91- val thumbnail = sourceImage.thumbnail (
92- " sample/src/main/resources/sample_images/rabbit.jpg " ,
93- 400
90+ val thumbnail = sourceImage.thumbnailImage (
91+ 400 ,
92+ VipsOption . Boolean ( " auto-rotate " , true ) // example of an option
9493 )
9594 val thumbnailWidth = thumbnail.width
9695 val thumbnailHeight = thumbnail.height
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ object VImageCreateThumbnailSample: RunnableSample {
2020 override fun run (arena : Arena , workingDirectory : Path ): Result <Unit > {
2121 val sourceImage = VImage .newFromFile(
2222 arena,
23- " sample/src/main/resources/sample_images/rabbit.jpg" ,
24- VipsOption .Enum (" access" , VipsAccess .ACCESS_SEQUENTIAL )
23+ " sample/src/main/resources/sample_images/rabbit.jpg"
2524 )
2625 val sourceWidth = sourceImage.width
2726 val sourceHeight = sourceImage.height
@@ -30,9 +29,9 @@ object VImageCreateThumbnailSample: RunnableSample {
3029 val outputPath = workingDirectory.resolve(" rabbit_copy.jpg" )
3130 sourceImage.writeToFile(outputPath.absolutePathString())
3231
33- val thumbnail = sourceImage.thumbnail (
34- " sample/src/main/resources/sample_images/rabbit.jpg " ,
35- 400
32+ val thumbnail = sourceImage.thumbnailImage (
33+ 400 ,
34+ VipsOption . Boolean ( " auto-rotate " , true ) // example of an option
3635 )
3736 val thumbnailWidth = thumbnail.width
3837 val thumbnailHeight = thumbnail.height
You can’t perform that action at this time.
0 commit comments