Mercurial > hg > orthanc
comparison Core/Toolbox.cpp @ 800:ecedd89055db
generation of DICOM images from PNG files
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 06 May 2014 16:33:40 +0200 |
parents | 203157cb4fde |
children | 4689e400e0fa |
comparison
equal
deleted
inserted
replaced
799:777b6b694da6 | 800:ecedd89055db |
---|---|
801 } | 801 } |
802 } | 802 } |
803 | 803 |
804 result.push_back(currentItem); | 804 result.push_back(currentItem); |
805 } | 805 } |
806 | |
807 | |
808 void Toolbox::DecodeDataUriScheme(std::string& mime, | |
809 std::string& content, | |
810 const std::string& source) | |
811 { | |
812 boost::regex pattern("data:([^;]+);base64,([a-zA-Z0-9=+/]*)", | |
813 boost::regex::icase /* case insensitive search */); | |
814 | |
815 boost::cmatch what; | |
816 if (regex_match(source.c_str(), what, pattern)) | |
817 { | |
818 mime = what[1]; | |
819 content = what[2]; | |
820 } | |
821 else | |
822 { | |
823 throw OrthancException(ErrorCode_BadFileFormat); | |
824 } | |
825 } | |
826 | |
806 } | 827 } |
807 | 828 |