Giter Site home page Giter Site logo

heif-utility-native-dll's Introduction

heif-utility-native-dll's People

Contributors

liuziangexit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

heif-utility-native-dll's Issues

How to save from JPG/JPEG/PNG to HEIC format

Thank you very much for your contributions on HEIF Utility lib, I have ported it on Android library and then convert between HEIC to JPG/JPEG is so easy.

Now, I want to convert from JPG/JPEG to HEIC, but I don't know how can separate the decoder config and image data from an image (jpg, jpeg files) as byte[] data.

Did you know, how I can do it, because the document is very difficult for understanding in Java code, and I think the C/C++ is better for trying.

请求帮助

cmake成xcode工程,编译无法通过,兄弟,能否提供命令行工具 for mac。

Image Collection in a HEIC File?

This HEIC Sample contains several images in this single container.
Could you help me and add the function to extract multible images from a HEIC file alongside finding out how many images it contains and the thumbnails of those images?

此程序能在linux编译和运行不

linux 上编译此程序,有一大堆错误,能否帮忙搞个Linux版本,非常感谢:

~/tmp/HEIF-Utility-Native-DLL/Srcs/HUD$ /usr/bin/c++ -std=c++11 -Wall -Wextra -Werror -Wno-missing-field-initializers -I/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common -I/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/jsonlib -I/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/parser -I/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader -I/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/writer -I/home/zsw/tmp/HEIF-Utility-Native-DLL/build -I/usr/include -o CMakeFiles/HUD.dir/main.cpp.o -c /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_Any.h:8:0,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:7,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:17:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_Exception.h:15:120: error: ‘U’ was not declared in this scope
template <typename T, class = typename std::enable_if<!std::is_same<typename std::decay::type, Exception>::value, U>::type>
^
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_Exception.h:15:121: error: template argument 2 is invalid
template <typename T, class = typename std::enable_if<!std::is_same<typename std::decay::type, Exception>::value, U>::type>
^
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:17:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h: In function ‘DC::PARS_V DC::GetCommandLineParameters(int, char**)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:41:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
for (PARS_V::size_type i = 0; i < argc; i++)
~~^~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h: In constructor ‘DC::KeyValuePair::KeyValuePair(DC::KeyValuePair&&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:165:21: error: ‘DC::KeyValuePair::value’ will be initialized after [-Werror=reorder]
std::string name, value;
^~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:164:8: error: ‘bool DC::KeyValuePair::OK’ [-Werror=reorder]
bool OK;
^~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:100:3: error: when initialized here [-Werror=reorder]
KeyValuePair(KeyValuePair&& input) :name(std::move(input.name)), value(std::move(input.value)), OK(input.OK) {
^~~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h: In member function ‘virtual void DC::KeyValuePair::Set(const string&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:135:21: error: NULL used in arithmetic [-Werror=pointer-arith]
if (input[i] != NULL) name += input[i];
^~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:138:21: error: NULL used in arithmetic [-Werror=pointer-arith]
if (input[i] != NULL) value += input[i];
^~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:18:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: In member function ‘void DC::STR::STRSpace::ReplaceInfo::setplace(T&&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:96:33: error: ‘decay_t’ is not a member of ‘std’
static_assert(std::is_same<std::decay_t, std::decay_t<decltype(whererp)>>::value, "input type doesnt right");
^~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:96:33: error: ‘decay_t’ is not a member of ‘std’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:96:47: error: wrong number of template arguments (1, should be 2)
static_assert(std::is_same<std::decay_t, std::decay_t<decltype(whererp)>>::value, "input type doesnt right");
^
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/type_traits:991:12: note: provided for ‘template<class, class> struct std::is_same’
struct is_same;
^~~~~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:18:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:96:50: error: expected string-literal before ‘std’
static_assert(std::is_same<std::decay_t, std::decay_t<decltype(whererp)>>::value, "input type doesnt right");
^~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:96:50: error: expected ‘)’ before ‘std’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: In function ‘int DC::STR::STRSpace::getbitvalue(const int&, const int&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:149:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (which > Howmuchdig(num)) return -1;
~~~~~~^~~~~~~~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: In function ‘std::_cxx11::string DC::STR::insertCHS(const string&, const string&, const size_t&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:209:30: error: comparison is always false due to limited range of data type [-Werror=type-limits]
if ((str[i] < 0 || str[i]>127) && (str[i + 1] < 0 || str[i + 1]>127)) { i++; count
++; }

/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:209:68: error: comparison is always false due to limited range of data type [-Werror=type-limits]
if ((str[i] < 0 || str[i]>127) && (str[i + 1] < 0 || str[i + 1]>127)) { i++; count_++; }

/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:218:19: error: NULL used in arithmetic [-Werror=pointer-arith]
if (str[i] != NULL) before.push_back(str[i]);
^~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:222:31: error: NULL used in arithmetic [-Werror=pointer-arith]
if (str[(realput + i)] != NULL) after.push_back(str[(realput)+i]);
^~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: In function ‘std::__cxx11::string DC::STR::getSub(const string&, const pos_type&, const pos_type&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:268:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (endpos < startpos || endpos>str.size() || endpos < 0) throw DC::DC_ERROR("pos illegal", 0);
~~~~~~^~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:271:41: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
for (std::size_t i = startpos + 1; i <= endpos - 1 && i < str.size(); i++)
^~~~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: At global scope:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:324:15: error: declaration of ‘std::__cxx11::string DC::STR::toString(const T&) noexcept [with T = int; std::__cxx11::string = std::__cxx11::basic_string]’ has a different exception specifier
std::string toString(const int& num)noexcept {
^~~~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:305:15: note: from previous declaration ‘std::__cxx11::string DC::STR::toString(const T&) [with T = int; std::__cxx11::string = std::__cxx11::basic_string]’
std::string toString(const T& value) {
^~~~~~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:19:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h: In function ‘std::__cxx11::string DC::File::read(const string&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:135:31: error: ‘decay_t’ is not a member of ‘std’
static_assert(std::is_same<std::decay_t, text>::value, "flag illegal");
^

/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:135:31: error: ‘decay_t’ is not a member of ‘std’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:135:48: error: wrong number of template arguments (1, should be 2)
static_assert(std::is_same<std::decay_t, text>::value, "flag illegal");
^
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/type_traits:991:12: note: provided for ‘template<class, class> struct std::is_same’
struct is_same;
^~~~~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:19:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:135:51: error: expected string-literal before ‘text’
static_assert(std::is_same<std::decay_t, text>::value, "flag illegal");
^~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:135:51: error: expected ‘)’ before ‘text’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h: In function ‘bool DC::File::write(const string&, const string&) [with FLAG = DC::File::binary; std::__cxx11::string = std::__cxx11::basic_string]’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:184:58: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (fwrite(write.c_str(), 1, write.size(), ptr.get()) == -1) return false;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h: In function ‘bool DC::File::writeAppend(const string&, const string&) [with FLAG = DC::File::binary; std::__cxx11::string = std::__cxx11::basic_string]’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_File.h:203:58: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (fwrite(write.c_str(), 1, write.size(), ptr.get()) == -1) return false;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp: In function ‘heifdata read_heif(const string&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:145:54: error: no matching function for call to ‘std::exception::exception(const char [29])’
throw std::exception("get_heif_info returned false");
^
In file included from /usr/include/c++/6/ios:39:0,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/exception:65:5: note: candidate: std::exception::exception()
exception() _GLIBCXX_USE_NOEXCEPT { }
^~~~~~~~~
/usr/include/c++/6/exception:65:5: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/6/exception:62:9: note: candidate: constexpr std::exception::exception(const std::exception&)
class exception
^~~~~~~~~
/usr/include/c++/6/exception:62:9: note: no known conversion for argument 1 from ‘const char [29]’ to ‘const std::exception&’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:149:58: error: no matching function for call to ‘std::exception::exception(const char [33])’
throw std::exception("get_heif_paramset returned false");
^
In file included from /usr/include/c++/6/ios:39:0,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/exception:65:5: note: candidate: std::exception::exception()
exception() _GLIBCXX_USE_NOEXCEPT { }
^~~~~~~~~
/usr/include/c++/6/exception:65:5: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/6/exception:62:9: note: candidate: constexpr std::exception::exception(const std::exception&)
class exception
^~~~~~~~~
/usr/include/c++/6/exception:62:9: note: no known conversion for argument 1 from ‘const char [33]’ to ‘const std::exception&’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:153:55: error: no matching function for call to ‘std::exception::exception(const char [30])’
throw std::exception("get_heif_tiles returned false");
^
In file included from /usr/include/c++/6/ios:39:0,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/exception:65:5: note: candidate: std::exception::exception()
exception() _GLIBCXX_USE_NOEXCEPT { }
^~~~~~~~~
/usr/include/c++/6/exception:65:5: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/6/exception:62:9: note: candidate: constexpr std::exception::exception(const std::exception&)
class exception
^~~~~~~~~
/usr/include/c++/6/exception:62:9: note: no known conversion for argument 1 from ‘const char [30]’ to ‘const std::exception&’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp: In function ‘std::vectorcv::Mat read_hevc_bitstream_to_mat_vector(const string&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:185:68: error: no matching function for call to ‘std::exception::exception(const char [42])’
throw std::exception("cv::VideoCapture::isOpened returned false");
^
In file included from /usr/include/c++/6/ios:39:0,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/exception:65:5: note: candidate: std::exception::exception()
exception() _GLIBCXX_USE_NOEXCEPT { }
^~~~~~~~~
/usr/include/c++/6/exception:65:5: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/6/exception:62:9: note: candidate: constexpr std::exception::exception(const std::exception&)
class exception
^~~~~~~~~
/usr/include/c++/6/exception:62:9: note: no known conversion for argument 1 from ‘const char [42]’ to ‘const std::exception&’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp: In function ‘cv::Mat resize(const cv::Mat&, const heifdata&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:222:58: error: no matching function for call to ‘CvRect::CvRect(int, int, const uint32_t&, const uint32_t&)’
cvSetImageROI(&img, CvRect(0, 0, info.width, info.height));
^
In file included from /usr/include/opencv2/core/core.hpp:49:0,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:6:
/usr/include/opencv2/core/types_c.h:951:16: note: candidate: CvRect::CvRect()
typedef struct CvRect
^~~~~~
/usr/include/opencv2/core/types_c.h:951:16: note: candidate expects 0 arguments, 4 provided
/usr/include/opencv2/core/types_c.h:951:16: note: candidate: constexpr CvRect::CvRect(const CvRect&)
/usr/include/opencv2/core/types_c.h:951:16: note: candidate expects 1 argument, 4 provided
/usr/include/opencv2/core/types_c.h:951:16: note: candidate: constexpr CvRect::CvRect(CvRect&&)
/usr/include/opencv2/core/types_c.h:951:16: note: candidate expects 1 argument, 4 provided
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp: In function ‘void rotate(cv::Mat&, const heifdata&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:235:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
for (int i = 0; i < info.rotation / 90; i++)
~~^~~~~~~~~~~~~~~~~~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp: In lambda function:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:242:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (output_buffer_size < source.size())
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/memory:81:0,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/editbox.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:18,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/bits/unique_ptr.h: In instantiation of ‘void std::unique_ptr<_Tp, _Dp>::reset(std::unique_ptr<_Tp, _Dp>::pointer) [with _Tp = DC::Any::Base; _Dp = std::default_deleteDC::Any::Base; std::unique_ptr<_Tp, _Dp>::pointer = DC::Any::Base*]’:
/usr/include/c++/6/bits/unique_ptr.h:254:7: required from ‘std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = DC::Any::Base; _Dp = std::default_deleteDC::Any::Base]’
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_Any.h:32:24: required from here
/usr/include/c++/6/bits/unique_ptr.h:345:6: error: call of overloaded ‘swap(DC::Any::Base*&, DC::Any::Base*&)’ is ambiguous
swap(std::get<0>(_M_t), __p);

In file included from /usr/include/c++/6/bits/nested_exception.h:40:0,
               from /usr/include/c++/6/exception:173,
               from /usr/include/c++/6/ios:39,
               from /usr/include/c++/6/ostream:38,
               from /usr/include/c++/6/iostream:39,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fourccint.hpp:17,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/bbox.hpp:16,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/fullbox.hpp:16,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/compositionoffsetbox.hpp:16,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/common/decodepts.hpp:16,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.hpp:16,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/reader/hevcimagefilereader.cpp:13,
               from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:2:
/usr/include/c++/6/bits/move.h:179:5: note: candidate: typename std::enable_if<std::__and_<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type std::swap(_Tp&, _Tp&) [with _Tp = DC::Any::Base*; typename std::enable_if<std::__and_<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type = void]
   swap(_Tp& __a, _Tp& __b)
   ^~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:17:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:31:43: note: candidate: void DC::swap(itemtype&, itemtype&) [with itemtype = DC::Any::Base*]
template <typename itemtype> inline void swap(itemtype& a, itemtype& b) {
                                         ^~~~
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h: At global scope:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/liuzianglib.h:155:23: error: inline function ‘virtual char DC::KeyValuePair::GetSeparator() const’ used but never defined [-Werror]
 virtual inline char GetSeparator()const noexcept = 0;
                     ^~~~~~~~~~~~
In file included from /home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/main.cpp:18:0:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h: In function ‘char DC::STR::STRSpace::getCharFromNum(const int&)’:
/home/zsw/tmp/HEIF-Utility-Native-DLL/Srcs/HUD/liuzianglib/DC_STR.h:177:4: error: control reaches end of non-void function [-Werror=return-type]
  }
  ^
cc1plus: all warnings being treated as errors

求助 liuziangexit/heif example.cpp 程序运行出错

有个问题想请教一下你, 我在github 上下了您的代码主题: liuziangexit/heif, 地址:https://github.com/liuziangexit/heif.git
我编译了: heif/Srcs/examples/example.cpp 这个文件后,测试一张iphone7所拍摄的heic图片后, 源代码如下:

#include "../../Srcs/reader/hevcimagefilereader.hpp"
#include
using namespace std;

void example1()
{
HevcImageFileReader reader;
reader.initialize("test_001.heic");
const auto& properties = reader.getFileProperties();

// Verify that the file has a cover image
if (not properties.fileFeature.hasFeature(ImageFileReaderInterface::FileFeature::HasCoverImage))
{
    return; // Nothing to do, just return.
}

// The cover image is always located in the root level MetaBox, so get MetaBox context ID.
const uint32_t contextId = properties.rootLevelMetaBoxProperties.contextId;

// Find the item ID
const uint32_t itemId = reader.getCoverImageItemId(contextId);

ImageFileReaderInterface::DataVector data;
reader.getItemDataWithDecoderParameters(contextId, itemId, data);

// Feed 'data' to decoder and display the cover image...

}

int main()
{
example1();

}

编译并运行后,出现以下错误,运行系统为 Linux debian 3.16.0-4-amd64:

zsw@debian:/tmp/heif/Srcs/examples$ ./example
Skipping an unknown box of type 'colr' in ItemPropertyContainer.
Skipping an unknown box of type 'pixi' in ItemPropertyContainer.
Skipping an unknown box of type 'colr' in ItemPropertyContainer.
Skipping an unknown box of type 'pixi' in ItemPropertyContainer.
terminate called after throwing an instance of 'std::out_of_range'**
what(): map::at
已放弃
zsw@debian:
/tmp/heif/Srcs/examples$

请帮忙分析下原因,谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.