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()
78
78
Vips .run { arena ->
79
79
val sourceImage = VImage .newFromFile(
80
80
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"
83
82
)
84
83
val sourceWidth = sourceImage.width
85
84
val sourceHeight = sourceImage.height
@@ -88,9 +87,9 @@ Vips.run { arena ->
88
87
val outputPath = workingDirectory.resolve(" rabbit_copy.jpg" )
89
88
sourceImage.writeToFile(outputPath.absolutePathString())
90
89
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
94
93
)
95
94
val thumbnailWidth = thumbnail.width
96
95
val thumbnailHeight = thumbnail.height
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ object VImageCreateThumbnailSample: RunnableSample {
20
20
override fun run (arena : Arena , workingDirectory : Path ): Result <Unit > {
21
21
val sourceImage = VImage .newFromFile(
22
22
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"
25
24
)
26
25
val sourceWidth = sourceImage.width
27
26
val sourceHeight = sourceImage.height
@@ -30,9 +29,9 @@ object VImageCreateThumbnailSample: RunnableSample {
30
29
val outputPath = workingDirectory.resolve(" rabbit_copy.jpg" )
31
30
sourceImage.writeToFile(outputPath.absolutePathString())
32
31
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
36
35
)
37
36
val thumbnailWidth = thumbnail.width
38
37
val thumbnailHeight = thumbnail.height
You can’t perform that action at this time.
0 commit comments