Skip to content

Commit

Permalink
Remove unsupported operations
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed May 3, 2021
1 parent 9bbda2f commit 0b1f62b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 1 addition & 3 deletions lib/vix/vips/blob.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
defmodule Vix.Vips.Blob do
@moduledoc """
*NOT supported yet*
"""
@moduledoc false

alias Vix.Type

Expand Down
2 changes: 2 additions & 0 deletions lib/vix/vips/image.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ defmodule Vix.Vips.Image do
@doc """
Returns `vips_image` as binary based on the format specified by `suffix`. This function is similar to `write_to_file` but instead of writing the output to the file, it returns it as a binary.
Currently only TIFF, JPEG and PNG formats are supported.
Save options may be encoded in the filename or given as a hash. For example:
```elixir
Expand Down
9 changes: 6 additions & 3 deletions lib/vix/vips/operation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ defmodule Vix.Vips.OperationHelper do
def reject_unsupported_operations(op_name) do
{_desc, args} = vips_operation_arguments(op_name)

# we do not support mutable operations yet
Enum.any?(args, fn %{flags: flags} ->
:vips_argument_modify in flags
Enum.any?(args, fn %{flags: flags, value_type: value_type} ->
# we do not support mutable operations yet. Skip operations which use un-supported types as arguments
:vips_argument_modify in flags ||
value_type == "VipsSource" ||
value_type == "VipsTarget" ||
value_type == "VipsBlob"
end)
end

Expand Down
4 changes: 1 addition & 3 deletions lib/vix/vips/source.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
defmodule Vix.Vips.Source do
@moduledoc """
*NOT supported yet*
"""
@moduledoc false

alias Vix.Type

Expand Down
4 changes: 1 addition & 3 deletions lib/vix/vips/target.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
defmodule Vix.Vips.Target do
@moduledoc """
*NOT supported yet*
"""
@moduledoc false

alias Vix.Type

Expand Down

0 comments on commit 0b1f62b

Please sign in to comment.