Open Voronchuk opened 7 years ago
The temporary file shouldn't need an extension, because when it is moved to your S3 bucket it will have an extension. Can I see where you're defining your transformation in the uploader definition?
In that case we use local storage, not S3.
Generally we take any kind of images (mostly jpeg) and transform them to transparent png.
@command_character "-thumbnail 200x200 -gravity center -extent 200x200 -fuzz 10% -transparent white -format png"
def transform(:thumb, scope) do
with {%{file_name: file_name}, object} when object != nil <- scope,
".svg" <- file_name |> Path.extname |> String.downcase
do
:noaction
else
{_, nil} ->
:noaction
_ ->
{:convert, &lazy_transform/2, :png}
end
end
defp lazy_transform(input, output) do
"#{input} #{@command_character} #{output}"
end
Pretty sure this issue is related to #198
I'm trying the following conversion:
-thumbnail 200x200 -gravity center -extent 200x200 -fuzz 10% -transparent white -format png
The resulted file still has white background, because temporary output file doesn't have any extension, conversion looks like the following:
I have fixed my issue with the following changes:
processor.ex
convert.ex
Does it make any sense?
Also I think that transformation customisations are the common case, mb we should put
Arc.Transformations.Convert
as a configurable module?