archrelease: copy trunk to community-any
[ArchLinux/community.git] / ciano / repos / community-x86_64 / 0001-Handle-GIF-with-ImageMagick.patch
blob491f03c58e1a688d406e25edcac95f388fbaace9
1 From 6444a3328b9ea85481b156ce2a8098c7b7847659 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
3 Date: Wed, 8 Jul 2020 14:48:38 +0200
4 Subject: [PATCH] Handle GIF with ImageMagick
6 Using FFmpeg could lead to crash. This removes support converting videos to animated GIF. See: #110
7 ---
8 src/Controllers/ConverterController.vala | 33 +++++-------------------
9 1 file changed, 6 insertions(+), 27 deletions(-)
11 diff --git a/src/Controllers/ConverterController.vala b/src/Controllers/ConverterController.vala
12 index b639d11..24402bb 100644
13 --- a/src/Controllers/ConverterController.vala
14 +++ b/src/Controllers/ConverterController.vala
15 @@ -370,7 +370,7 @@ namespace Ciano.Controllers {
16 break;
17 } else {
18 // there is no return on image conversion, if display is pq was generated some error.
19 - if (item.type_item != TypeItemEnum.IMAGE || this.name_format_selected.down () == "gif") {
20 + if (item.type_item != TypeItemEnum.IMAGE) {
21 process_line (str_return, row, ref total, error);
23 if (error > 0) {
24 @@ -552,26 +552,8 @@ namespace Ciano.Controllers {
25 array.add ("-2");
26 array.add (new_file);
27 } else if (this.type_item == TypeItemEnum.IMAGE) {
28 - if (this.name_format_selected.down () == "gif") {
29 - array.add ("ffmpeg");
30 - array.add ("-y");
31 - array.add ("-i");
32 - array.add (uri);
34 - if("webm" == FileUtil.get_file_extension_name(uri)) {
35 - array.add ("-pix_fmt");
36 - array.add ("rgb8");
37 - } else {
38 - array.add ("-ss");
39 - array.add ("00:00:00.000");
40 - array.add ("-vf");
41 - array.add ("format=rgb8,format=rgb24");
42 - }
43 - } else {
44 - array.add ("convert");
45 - array.add (uri);
46 - }
48 + array.add ("convert");
49 + array.add (uri);
50 array.add (new_file);
53 @@ -738,10 +720,7 @@ namespace Ciano.Controllers {
54 formats = get_array_formats_image (Constants.TEXT_ICO);
55 break;
56 case Constants.TEXT_GIF:
57 - formats = ArrayUtil.join_generic_string_arrays (
58 - get_array_formats_image (Constants.TEXT_GIF),
59 - get_array_formats_videos (StringUtil.EMPTY)
60 - );
61 + formats = get_array_formats_image (Constants.TEXT_GIF);
62 break;
63 case Constants.TEXT_TGA:
64 formats = get_array_formats_image (Constants.TEXT_TGA);
65 @@ -821,7 +800,7 @@ namespace Ciano.Controllers {
66 array.add (Constants.TEXT_OGV.up());
69 - if(format_video != Constants.TEXT_WEBM && format_video != Constants.TEXT_GIF && this.type_item == TypeItemEnum.VIDEO) {
70 + if(format_video != Constants.TEXT_WEBM) {
71 array.add (Constants.TEXT_WEBM);
72 array.add (Constants.TEXT_WEBM.up());
74 --
75 2.27.0