@@ -48,8 +48,8 @@ defmodule Banchan.Workers.Thumbnailer do
48
48
Uploads . gen_pending (
49
49
% User { id: upload . uploader_id } ,
50
50
upload ,
51
- "image/jpeg " ,
52
- Keyword . get ( opts , :name , "thumbnail.jpg " )
51
+ "image/png " ,
52
+ Keyword . get ( opts , :name , "thumbnail.png " )
53
53
)
54
54
)
55
55
|> Ecto.Multi . run ( :job , fn _repo , % { pending: pending } ->
@@ -58,9 +58,8 @@ defmodule Banchan.Workers.Thumbnailer do
58
58
src: upload . id ,
59
59
dest: pending . id ,
60
60
opts: % {
61
- target_size: Keyword . get ( opts , :target_size ) ,
62
- format: Keyword . get ( opts , :format , "jpeg" ) ,
63
- dimensions: Keyword . get ( opts , :dimensions )
61
+ dimensions: Keyword . get ( opts , :dimensions ) ,
62
+ upscale: Keyword . get ( opts , :upscale )
64
63
}
65
64
} )
66
65
)
@@ -106,15 +105,15 @@ defmodule Banchan.Workers.Thumbnailer do
106
105
if Uploads . video? ( src ) do
107
106
duration = FFprobe . duration ( tmp_src )
108
107
109
- output_src = Path . join ( [ System . tmp_dir! ( ) , src . key <> ".jpeg " ] )
108
+ output_src = Path . join ( [ System . tmp_dir! ( ) , src . key <> ".png " ] )
110
109
111
110
command =
112
111
FFmpex . new_command ( )
113
112
|> add_global_option ( option_y ( ) )
114
113
|> add_input_file ( tmp_src )
115
114
|> add_output_file ( output_src )
116
115
|> add_file_option ( option_f ( "image2" ) )
117
- |> add_file_option ( option_filter ( "scale=128:128 " ) )
116
+ |> add_file_option ( option_filter ( "scale=512:512 " ) )
118
117
|> add_file_option ( option_ss ( round ( duration / 2 ) ) )
119
118
|> add_file_option ( option_vframes ( 1 ) )
120
119
0 commit comments