Skip to content

Commit

Permalink
add xmp test
Browse files Browse the repository at this point in the history
  • Loading branch information
Isotr0py committed May 10, 2024
1 parent 909b650 commit ed68dae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions jpegxl-rs/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod encode;
pub const SAMPLE_PNG: &[u8] = include_bytes!("../../samples/sample.png");
const SAMPLE_JPEG: &[u8] = include_bytes!("../../samples/sample.jpg");
const SAMPLE_EXIF: &[u8] = include_bytes!("../../samples/sample.exif");
const SAMPLE_XMP: &[u8] = include_bytes!("../../samples/sample.xmp");
pub const SAMPLE_JXL: &[u8] = include_bytes!("../../samples/sample.jxl");
const SAMPLE_JXL_JPEG: &[u8] = include_bytes!("../../samples/sample_jpg.jxl");
pub const SAMPLE_JXL_GRAY: &[u8] = include_bytes!("../../samples/sample_grey.jxl");
Expand Down
1 change: 1 addition & 0 deletions jpegxl-rs/src/tests/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn metadata() -> TestResult {
let sample = get_sample().to_rgb8();
let mut encoder = encoder_builder().build()?;
encoder.add_metadata(&Metadata::Exif(super::SAMPLE_EXIF), true)?;
encoder.add_metadata(&Metadata::Xmp(super::SAMPLE_XMP), true)?;

let _res: EncoderResult<u8> =
encoder.encode(sample.as_raw(), sample.width(), sample.height())?;
Expand Down
1 change: 1 addition & 0 deletions samples/sample.xmp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:GIMP="http://www.gimp.org/xmp/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmpMM:DocumentID="gimp:docid:gimp:10093e7e-33ea-4901-a7ce-a3c04b8b6480" xmpMM:InstanceID="xmp.iid:737430f3-5b4d-49cf-9873-c10684618917" xmpMM:OriginalDocumentID="xmp.did:f7302aac-e69b-4ad8-ac19-58a76e2fc4f7" dc:Format="image/jpeg" GIMP:API="2.0" GIMP:Platform="Linux" GIMP:TimeStamp="1635353959433667" GIMP:Version="2.10.28" xmp:CreatorTool="GIMP 2.10"> <xmpMM:History> <rdf:Seq> <rdf:li stEvt:action="saved" stEvt:changed="/metadata" stEvt:instanceID="xmp.iid:735c4bc4-11be-4e71-8aad-0ddd90c9607d" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="2021-10-27T18:58:46+02:00"/> <rdf:li stEvt:action="saved" stEvt:changed="/" stEvt:instanceID="xmp.iid:70d81176-171d-43b8-b687-1eb80d302337" stEvt:softwareAgent="Gimp 2.10 (Linux)" stEvt:when="2021-10-27T18:59:19+02:00"/> </rdf:Seq> </xmpMM:History> <dc:title> <rdf:Alt> <rdf:li xml:lang="x-default">test</rdf:li> </rdf:Alt> </dc:title> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="w"?>

0 comments on commit ed68dae

Please sign in to comment.