@@ -42,9 +42,11 @@ import snag
4242/// own vips binary on the host system to. See the package readme for details.
4343///
4444/// The `Custom` constructor allows for advanced vips save options to be
45- /// used, like `ansel.Custom(".png", "[compression=90,squash=true]")`, refer to the
46- /// [Vix package documentation](https://hexdocs.pm/vix/Vix.Vips.Image.html#write_to_file/2)
47- /// for details.
45+ /// used as a comma separated list, like `ansel.Custom(".png", "compression=90,squash=true")`,
46+ /// which is equivalent to the `.png[compression=90,squash=true]` syntax used in vips.
47+ ///
48+ /// You can use the libvips CLI to print a list of all supported options for each image format,
49+ /// e.g. `vips pngsave`, `vips jpegsave`.
4850pub type ImageFormat {
4951 JPEG ( quality : Int , keep_metadata : Bool )
5052 JPEG2000 ( quality : Int , keep_metadata : Bool )
@@ -100,7 +102,8 @@ fn image_format_to_string(format: ImageFormat) -> FormatComponents {
100102 Analyze -> FormatComponents ( ".analyze" , "" )
101103 NIfTI -> FormatComponents ( ".nii" , "" )
102104 DeepZoom -> FormatComponents ( ".dzi" , "" )
103- Custom ( extension : , format : ) -> FormatComponents ( extension , format )
105+ Custom ( extension : , format : ) ->
106+ FormatComponents ( extension , "[" <> format <> "]" )
104107 }
105108}
106109
0 commit comments