summaryrefslogtreecommitdiff
path: root/media-libs/libopenshot/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-10-22 11:09:47 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-10-22 11:09:47 +0100
commit64e107b9b6058580ff0432107eb37cefb0b2a7d8 (patch)
tree9a44e603e2ae365e2b1fe35ac37f73e830cdee1d /media-libs/libopenshot/files
parent957235cf19a691360c720f7913672adda4258ed0 (diff)
gentoo resync : 22.10.2018
Diffstat (limited to 'media-libs/libopenshot/files')
-rw-r--r--media-libs/libopenshot/files/libopenshot-0.1.3-fix-tests.patch26
-rw-r--r--media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch78
2 files changed, 78 insertions, 26 deletions
diff --git a/media-libs/libopenshot/files/libopenshot-0.1.3-fix-tests.patch b/media-libs/libopenshot/files/libopenshot-0.1.3-fix-tests.patch
deleted file mode 100644
index 8ed3102b7adc..000000000000
--- a/media-libs/libopenshot/files/libopenshot-0.1.3-fix-tests.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index 29fbe45..ff67cb5 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -24,16 +24,19 @@
- # along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
- ################################################################################
-
-+SET(TEST_MEDIA_PATH "${openshot_SOURCE_DIR}/src/examples/")
-
- ################ WINDOWS ##################
- # Set some compiler options for Windows
- # required for libopenshot-audio headers
- IF (WIN32)
-- STRING(REPLACE "/" "\\\\" TEST_MEDIA_PATH "${openshot_SOURCE_DIR}/src/examples/")
-- add_definitions( -DIGNORE_JUCE_HYPOT=1 -DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
-+ STRING(REPLACE "/" "\\\\" TEST_MEDIA_PATH TEST_MEDIA_PATH)
-+ add_definitions( -DIGNORE_JUCE_HYPOT=1 )
- SET(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -include cmath -std=c++0x")
- ENDIF(WIN32)
-
-+add_definitions( -DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
-+
- ################### UNITTEST++ #####################
- # Find UnitTest++ libraries (used for unit testing)
- FIND_PACKAGE(UnitTest++ REQUIRED)
diff --git a/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch
new file mode 100644
index 000000000000..bc5f738d7f63
--- /dev/null
+++ b/media-libs/libopenshot/files/libopenshot-0.2.2-imagemagick7.patch
@@ -0,0 +1,78 @@
+diff -Nru a/include/TextReader.h b/include/TextReader.h
+--- a/include/TextReader.h 2018-09-22 21:47:46.000000000 +0200
++++ b/include/TextReader.h 2018-09-23 16:17:21.212888285 +0200
+@@ -91,7 +91,7 @@
+ string text_color;
+ string background_color;
+ std::shared_ptr<Magick::Image> image;
+- list<Magick::Drawable> lines;
++ vector<Magick::Drawable> lines;
+ bool is_open;
+ GravityType gravity;
+
+diff -Nru a/src/Frame.cpp b/src/Frame.cpp
+--- a/src/Frame.cpp 2018-09-22 21:47:46.000000000 +0200
++++ b/src/Frame.cpp 2018-09-23 16:21:44.921563711 +0200
+@@ -29,6 +29,9 @@
+
+ using namespace std;
+ using namespace openshot;
++#ifdef USE_IMAGEMAGICK
++using namespace Magick;
++#endif
+
+ // Constructor - blank frame (300x200 blank image, 48kHz audio silence)
+ Frame::Frame() : number(1), pixel_ratio(1,1), channels(2), width(1), height(1), color("#000000"),
+@@ -904,7 +907,7 @@
+ // Give image a transparent background color
+ magick_image->backgroundColor(Magick::Color("none"));
+ magick_image->virtualPixelMethod(Magick::TransparentVirtualPixelMethod);
+- magick_image->matte(true);
++ magick_image->alpha(true);
+
+ return magick_image;
+ }
+@@ -926,13 +929,14 @@
+ // Iterate through the pixel packets, and load our own buffer
+ // Each color needs to be scaled to 8 bit (using the ImageMagick built-in ScaleQuantumToChar function)
+ int numcopied = 0;
+- Magick::PixelPacket *pixels = new_image->getPixels(0,0, new_image->columns(), new_image->rows());
++ const Quantum *pixels = new_image->getConstPixels(0,0, new_image->columns(), new_image->rows());
+ for (int n = 0, i = 0; n < new_image->columns() * new_image->rows(); n += 1, i += 4) {
+- buffer[i+0] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].red);
+- buffer[i+1] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].green);
+- buffer[i+2] = MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].blue);
+- buffer[i+3] = 255 - MagickCore::ScaleQuantumToChar((Magick::Quantum) pixels[n].opacity);
++ buffer[i+0] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelRed(new_image->image(), pixels));
++ buffer[i+1] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelGreen(new_image->image(), pixels));
++ buffer[i+2] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelBlue(new_image->image(), pixels));
++ buffer[i+3] = MagickCore::ScaleQuantumToChar(MagickCore::GetPixelAlpha(new_image->image(), pixels));
+ numcopied+=4;
++ pixels += MagickCore::GetPixelChannels(new_image->image());
+ }
+
+ // Create QImage of frame data
+diff -Nru a/src/ImageReader.cpp b/src/ImageReader.cpp
+--- a/src/ImageReader.cpp 2018-09-22 21:47:46.000000000 +0200
++++ b/src/ImageReader.cpp 2018-09-23 16:22:32.330865516 +0200
+@@ -59,7 +59,7 @@
+
+ // Give image a transparent background color
+ image->backgroundColor(Magick::Color("none"));
+- image->matte(true);
++ image->alpha(true);
+ }
+ catch (Magick::Exception e) {
+ // raise exception
+diff -Nru a/src/ImageWriter.cpp b/src/ImageWriter.cpp
+--- a/src/ImageWriter.cpp 2018-09-22 21:47:46.000000000 +0200
++++ b/src/ImageWriter.cpp 2018-09-23 16:22:58.380031419 +0200
+@@ -97,7 +97,7 @@
+ std::shared_ptr<Magick::Image> frame_image = frame->GetMagickImage();
+ frame_image->magick( info.vcodec );
+ frame_image->backgroundColor(Magick::Color("none"));
+- frame_image->matte(true);
++ frame_image->alpha(true);
+ frame_image->quality(image_quality);
+ frame_image->animationDelay(info.video_timebase.ToFloat() * 100);
+ frame_image->animationIterations(number_of_loops);