1 |
commit: 29cab30f7f561478237caca8337d0ef7c2f69120 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 13 17:32:36 2018 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 13 17:35:28 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29cab30f |
7 |
|
8 |
media-libs/libopenshot: Commit the patch |
9 |
|
10 |
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
.../files/libopenshot-0.2.2-imagemagick7.patch | 78 ++++++++++++++++++++++ |
14 |
1 file changed, 78 insertions(+) |
15 |
|
16 |
diff --git a/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..bc5f738d7f6 |
19 |
--- /dev/null |
20 |
+++ b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch |
21 |
@@ -0,0 +1,78 @@ |
22 |
+diff -Nru a/include/TextReader.h b/include/TextReader.h |
23 |
+--- a/include/TextReader.h 2018-09-22 21:47:46.000000000 +0200 |
24 |
++++ b/include/TextReader.h 2018-09-23 16:17:21.212888285 +0200 |
25 |
+@@ -91,7 +91,7 @@ |
26 |
+ string text_color; |
27 |
+ string background_color; |
28 |
+ std::shared_ptr<Magick::Image> image; |
29 |
+- list<Magick::Drawable> lines; |
30 |
++ vector<Magick::Drawable> lines; |
31 |
+ bool is_open; |
32 |
+ GravityType gravity; |
33 |
+ |
34 |
+diff -Nru a/src/Frame.cpp b/src/Frame.cpp |
35 |
+--- a/src/Frame.cpp 2018-09-22 21:47:46.000000000 +0200 |
36 |
++++ b/src/Frame.cpp 2018-09-23 16:21:44.921563711 +0200 |
37 |
+@@ -29,6 +29,9 @@ |
38 |
+ |
39 |
+ using namespace std; |
40 |
+ using namespace openshot; |
41 |
++#ifdef USE_IMAGEMAGICK |
42 |
++using namespace Magick; |
43 |
++#endif |
44 |
+ |
45 |
+ // Constructor - blank frame (300x200 blank image, 48kHz audio silence) |
46 |
+ Frame::Frame() : number(1), pixel_ratio(1,1), channels(2), width(1), height(1), color("#000000"), |
47 |
+@@ -904,7 +907,7 @@ |
48 |
+ // Give image a transparent background color |
49 |
+ magick_image->backgroundColor(Magick::Color("none")); |
50 |
+ magick_image->virtualPixelMethod(Magick::TransparentVirtualPixelMethod); |
51 |
+- magick_image->matte(true); |
52 |
++ magick_image->alpha(true); |
53 |
+ |
54 |
+ return magick_image; |
55 |
+ } |
56 |
+@@ -926,13 +929,14 @@ |
57 |
+ // Iterate through the pixel packets, and load our own buffer |
58 |
+ // Each color needs to be scaled to 8 bit (using the ImageMagick built-in ScaleQuantumToChar function) |
59 |
+ int numcopied = 0; |
60 |
+- Magick::PixelPacket *pixels = new_image->getPixels(0,0, new_image->columns(), new_image->rows()); |
61 |
++ const Quantum *pixels = new_image->getConstPixels(0,0, new_image->columns(), new_image->rows()); |
62 |
+ for (int n = 0, i = 0; n < new_image->columns() * new_image->rows(); n += 1, i += 4) { |
63 |
+- buffer[i+0] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].red); |
64 |
+- buffer[i+1] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].green); |
65 |
+- buffer[i+2] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].blue); |
66 |
+- buffer[i+3] = 255 - MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].opacity); |
67 |
++ buffer[i+0] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelRed(new_image->image(), pixels)); |
68 |
++ buffer[i+1] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelGreen(new_image->image(), pixels)); |
69 |
++ buffer[i+2] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelBlue(new_image->image(), pixels)); |
70 |
++ buffer[i+3] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelAlpha(new_image->image(), pixels)); |
71 |
+ numcopied+=4; |
72 |
++ pixels += MagickCore::GetPixelChannels(new_image->image()); |
73 |
+ } |
74 |
+ |
75 |
+ // Create QImage of frame data |
76 |
+diff -Nru a/src/ImageReader.cpp b/src/ImageReader.cpp |
77 |
+--- a/src/ImageReader.cpp 2018-09-22 21:47:46.000000000 +0200 |
78 |
++++ b/src/ImageReader.cpp 2018-09-23 16:22:32.330865516 +0200 |
79 |
+@@ -59,7 +59,7 @@ |
80 |
+ |
81 |
+ // Give image a transparent background color |
82 |
+ image->backgroundColor(Magick::Color("none")); |
83 |
+- image->matte(true); |
84 |
++ image->alpha(true); |
85 |
+ } |
86 |
+ catch (Magick::Exception e) { |
87 |
+ // raise exception |
88 |
+diff -Nru a/src/ImageWriter.cpp b/src/ImageWriter.cpp |
89 |
+--- a/src/ImageWriter.cpp 2018-09-22 21:47:46.000000000 +0200 |
90 |
++++ b/src/ImageWriter.cpp 2018-09-23 16:22:58.380031419 +0200 |
91 |
+@@ -97,7 +97,7 @@ |
92 |
+ std::shared_ptr<Magick::Image> frame_image = frame->GetMagickImage(); |
93 |
+ frame_image->magick( info.vcodec ); |
94 |
+ frame_image->backgroundColor(Magick::Color("none")); |
95 |
+- frame_image->matte(true); |
96 |
++ frame_image->alpha(true); |
97 |
+ frame_image->quality(image_quality); |
98 |
+ frame_image->animationDelay(info.video_timebase.ToFloat() * 100); |
99 |
+ frame_image->animationIterations(number_of_loops); |