File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ protected function __construct (?string $data = null, bool $format = false) {
6464 }
6565
6666 public static function create (?string $ data = null , bool $ format = false ) : XMP {
67+ //x:xmpmeta (or x:xapmeta for older files) element
68+ $ data = preg_replace ('~<x:xapmeta(.*)</x:xapmeta>~Uims ' , '<x:xmpmeta$1</x:xmpmeta> ' , $ data );
69+
6770 return new static ($ data , $ format );
6871 }
6972
@@ -74,7 +77,8 @@ public static function create (?string $data = null, bool $format = false) : XMP
7477 * @return null|XMP
7578 */
7679 public static function readBlob (string $ blob ) : ?XMP {
77- if (!preg_match ('~<x:xmpmeta.*</x:xmpmeta>~Uims ' , $ blob , $ xmps )) {
80+ //x:xmpmeta (or x:xapmeta for older files) element
81+ if (!preg_match ('~<x:xmpmeta.*</x:xmpmeta>|<x:xapmeta.*</x:xapmeta>~Uims ' , $ blob , $ xmps )) {
7882 return null ;
7983 }
8084
You can’t perform that action at this time.
0 commit comments