2017-04-29 19:44:39 +00:00
|
|
|
/**
|
|
|
|
* Image operation tests.
|
|
|
|
*
|
|
|
|
* @author tlwr [toby@toby.codes]
|
|
|
|
*
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
import TestRegister from "../../TestRegister.js";
|
|
|
|
|
|
|
|
TestRegister.addTests([
|
|
|
|
{
|
|
|
|
name: "Extract EXIF: nothing",
|
|
|
|
input: "",
|
|
|
|
expectedOutput: "Found 0 tags.\n",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "Extract EXIF",
|
|
|
|
args: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Extract EXIF: hello world text (error)",
|
|
|
|
input: "hello world",
|
|
|
|
expectedError: true,
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "Extract EXIF",
|
|
|
|
args: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Extract EXIF: meerkat jpeg",
|
|
|
|
input: "ffd8ffe12cd645786966000049492a000800000008000f01020004000000534f4e5910010200060000006e0000001a01050001000000740000001b010500010000007c0000002801030001000000020000003101020011000000840000003201020013000000960000006987040001000000aa000000300200004453432d483546000000010000004600000001000000506963746f6d696f20312e322e33312e3000323031303a30373a30342032333a33313a31330018009a82050001000000d00100009d82050001000000d80100002288030001000000030000002788030001000000c80000000090070004000000303232310390020013000000e00100000490020013000000f401000001920500010000000802000002920500010000001002000004920500010000001802000005920500010000002002000007920300010000000500000008920300010000000a0000000992030001000000100000000a920500010000002802000000a30700010000000300000001a30700010000000100000001a40300010000000000000002a40300010000000100000003a40300010000000100000006a40300010000000000000008a40300010000000000000009a4030001000000000000000aa40300010000000000000000000000010000007d000000250000000a000000323030383a30393a30312031333a32343a343600323030383a30393a30312031333a32343a34360043490d0048e801004b9a390040420f00030000000a0000000300000001000000480000000100000006000301030001000000060000001a010500010000007e0200001b010500010000008602000028010300010000000200000001020400010000008e0200000202040001000000402a00000000000048000000010000004800000001000000ffd8ffee000e41646f626500640000000001ffdb0084000604040405040605050609060506090b080606080b0c0a0a0b0a0a0c100c0c0c0c0c0c100c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c010707070d0c0d18101018140e0e0e14140e0e0e0e14110c0c0c0c0c11110c0c0c0c0c0c110c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0cffc0001108009600c803011100021101031101ffdd00040019ffc401a20000000701010101010000000000000000040503020601000708090a0b0100020203010101010100000000000000010002030405060708090a0b1000020103030204020607030402060273010203110400052112314151061361227181143291a10715b14223c152d1e1331662f0247282f12543345392a2b26373c235442793a3b33617546474c3d2e2082683090a181984944546a4b456d355281af2e3f3c4d4e4f465758595a5b5c5d5e5f566768696a6b6c6d6e6f637475767778797a7b7c7d7e7f738485868788898a8b8c8d8e8f82939495969798999a9b9c9d9e9f92a3a4a5a6a7a8a9aaabacadaeafa110002020102030505040506040803036d0100021103042112314105511361220671819132a1b1f014c1d1e1234215526272f1332434438216925325a263b2c20773d235e2448317549308090a18192636451a2764745537f2a3b3c32829d3e3f38494a4b4c4d4e4f465758595a5b5c5d5e5f5465666768696a6b6c6d6e6f6475767778797a7b7c7d7e7f738485868788898a8b8c8d8e8f839495969798999a9b9c9d9e9f92a3a4a5a6a7a8a9aaabacadaeafaffda000c03010002110311003f00068bb671e5ec1500c895b5400786055e0605b5ea299129b545514c16ab82e2b6b80c516b82e295ca315b5c46050b9062825b0a2b8a82adf55b836ef70b133411b057900a852454571a357d11c62ebaa826f51b50f5af862032979ac5708eb0cad546da094f6ff8adbfe346c953ae8e43827c32feee5f47f47fa2b9e4890ee457c303b0b433dcc209a9c09b506d56d83701b9c3c2bc4be1bf59eb6ccb40ff00ddb1e9c8fec9f66cb211b15fe95c5cf5cf9ff3ff00a51412464b1d3e4f85812f68e7a83dd3018f107439316fe19feb6197fbd745752c442c8ed1988f10c3aa7b1ff23fe23950241a29d2eb4e3f44fe8ff728860797271490ee581d9ab92301541da4e24476fde63284bfb58d11a651d0fef546d556f84ed8217f49ff0035d16a3181c94ed4b346fbd67b71461fefc8bfaad7fe0732f04fbf91630f5c2bf8a1fee3fe3aff00ffd00a99c717af541b9c0abc75c8aaa0029810bc0c8b2545c50bc0df155d4c2ad8a57052b7551df0d2b46788756c095a2fe05069b9c6d0a2faa00d451538f35b0ad6be60d46c64f56df70769216dd1d7f95864a13312d5931c6628a672d85bf9821375e5f6105ea0adce8f25036dd5a13fb43db2e38c4b787fa4718669e2353f547f9fff0014904f1dca318a6a823692361423da9d8e5039b7e58472468f229dfe83b6d4b4d8a6d32491b51863a5cdb486a6523a98cff353f63f97098f1721bffba70f067384f873e5fce48dec4f1e5f687ed53a83e0464625cff1624d214daf097971ad7a65b128914472e2952a30128017dc017f685e3dae6021891d6a3bd7df264dfa87f9ceb357a6b143fad8ff00e23fe250a6637aa250804f1ad24a7ed53c464270120e9b248e4dcfd4b6deec5bd15aaf68db78b467dbfc9caa122369391a3d71c468ef044cc11d0c7b3c32a90ac3a6e3a8396bbac9a686685c7aa4a92b251892ae84c335363edfc460eb4f2e4984bb8fd2ff00ffd10a8338e2f5eaa06f8155141c0aa82806e70522da7b98106ec2be18045287975544601456b92114134abfa45a80f1d8f438d23896bdf4bd875c8af129b4b75
|
|
|
|
expectedOutput: [
|
|
|
|
"Found 28 tags.",
|
|
|
|
"",
|
|
|
|
"Make: SONY",
|
|
|
|
"Model: DSC-H5",
|
|
|
|
"XResolution: 72",
|
|
|
|
"YResolution: 72",
|
|
|
|
"ResolutionUnit: 2",
|
|
|
|
"Software: Pictomio 1.2.31.0",
|
|
|
|
"ModifyDate: 2010:07:04 23:31:13",
|
|
|
|
"ExposureTime: 0.008",
|
|
|
|
"FNumber: 3.7",
|
|
|
|
"ExposureProgram: 3",
|
|
|
|
"ISO: 200",
|
|
|
|
"DateTimeOriginal: 1220275486",
|
|
|
|
"CreateDate: 1220275486",
|
|
|
|
"ShutterSpeedValue: 6.965784",
|
|
|
|
"ApertureValue: 3.775051",
|
|
|
|
"ExposureCompensation: 0.3",
|
|
|
|
"MaxApertureValue: 3",
|
|
|
|
"MeteringMode: 5",
|
|
|
|
"LightSource: 10",
|
|
|
|
"Flash: 16",
|
|
|
|
"FocalLength: 72",
|
|
|
|
"CustomRendered: 0",
|
|
|
|
"ExposureMode: 1",
|
|
|
|
"WhiteBalance: 1",
|
|
|
|
"SceneCaptureType: 0",
|
|
|
|
"Contrast: 0",
|
|
|
|
"Saturation: 0",
|
|
|
|
"Sharpness: 0",
|
|
|
|
].join("\n"),
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "From Hex",
|
2017-05-08 16:45:42 +00:00
|
|
|
args: ["None"]
|
2017-04-29 19:44:39 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
op: "Extract EXIF",
|
|
|
|
args: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Extract EXIF: avatar jpeg",
|
|
|
|
input: "ffd8ffdb008400080606070605080707070909080a0c140d0c0b0b0c1912130f141d1a1f1e1d1a1c1c20242e2720222c231c1c2837292c30313434341f27393d38323c2e333432010909090c0b0c180d0d1832211c213232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232ffc00011080058005803012200021101031101ffc401a20000010501010101010100000000000000000102030405060708090a0b100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9fa0100030101010101010101010000000000000102030405060708090a0b1100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00f39d2237f3223f398e3765047cb8c95ee0f1d6b73c66037852c2786479049772073d7e652ca09ef9da1067bedef597e15b382ffcd6b89248e08d1a57208c95040c73c67381fad6f6a176ff00f08d491adbdb5bc12cd3b24580f85405b71cf392463230319ae09de334cf16ab71aa9f6397b2bb824d34690d641e6ba789d67de4ec55dc08db8e739ffc77a77ad6f14c7e4e8f3a12c156ed157e5c06468f7af18e0ae48fc4d72d2cc069ab2c4e1255941054004647b723fce2afbea4b35bc534c91ce63456944a5fe7cf1cfcdea2b4941b69f6379d36e4a48c270c08638e4e79c1a78cb49c138dfcae00ae96d239b5dba8ec2db4eb37915c6c2a879382704e7a7afa558d6f4fb7d1960b696dedbce89dbed3322ee5dc73b541ce7181d7dcfb55f3f4ea5fb7d795ad4e6e20de747f7940751b94e0823dfd7393f8557946f676ddb882492ddfd4d74497da4b3208e21bd54b380a4ab10383c9fef13dbd2b2afedada1b62f1caccce0328ddca8c904118f507d288b77d8709b6f556330f2d96ce3a015bda8d9a4766080b1b9c30dc39202038f6ebfad610daad8dd93d2ba0d5ee20480c250b398c6370230c55727f43c7b83454bdd58755be68a464a320310192cbcb7bf3c7d2ad79c3fe790ffbec5500c1ee03e554f650381cf4ab7e637aaffdf34e511ca26ef871e38f4c2b72ec90dcc7246c40e87820f1fed0157ee58c1e1f8e1701fcfb7bb73701b2782c17278e4e31f8d67787525bab3b6b5891371903296c839049233d8607a7f2a97c617d6443450cafbc41e4f979cedc480e4e3f88e1f3e84d6325cd3b1c938f355e5f3ff339b1103a0ceed8c89230b93cf20f6ff3d2b4edec74a78205b9bc811c4232584ae33d7b0c743eb546403fe11e90855199a2048ebf75bfcfe745a45e749045bbefe130173d87f3ade5b5cea95da7adb5fd0f45d3751d3f4ad16eff00b25650af84fb43a005c842c4a8c7ca33dbdfd79a5b1d60ae9aaef70ce59fe645c640c77eb8f5ed54b50b29345f0d258c36acf700abf9dbb2a176307e339c92c3f2ac981e5b8d26178623b3cdd8caa48f9b1d40fcff004af1e718d6bcaf7573c274a15ef34ee9b23d62cac6fa39aeac24115c451ab02bf2994606e040ee3afe159fae5d68973046d60eff00687b687cc528c01942fef0e48ee467d39ae834ad2ede7d3cdc4c678eecec4822519121dca1b771c0c67b8fc78ae28c6ff69103e4183cc420f452303f9d77e167bc2f7b1e9611ef0bdec5265c3b1381c9ad2d5a4f308da98071839cf1b4553995448e064904d68eaa85d62906d0b21200ce4f0060febfa57549ea8ed93f7a2674118f35493d4f738ef5a1e5c7ea2a8daa05ba0092464638f715b388ff00baff0097ff005aa66f514e5a973c2d7690de69ee085114d997cb3c84dc324e781c1c0fcbbd67f8b12d12ee21668c525432f98c319dc49c019ec49ebcd47a6ca122910a9632945dc075f99491fa51ae4cb75696770a71b435bb26dc7cc9b4023eaa53f106a52b4ccd46d56e432b29f0dedd8438953e6f6c356cf83a289b534bc755cc4b84c91f78a63fa1ac09a50da394c6312263fef8357bc3b7820bd87cc70a98663ce390b91fd696222dd29242c44252a334ba9deea69fdadaed858c7ff1eed3624562402157241f6e2ae8f045b2ea4f7104b2a83f398a33f2ff00fab9e94786d22bbf10ea17330c24312c28ad93b778dcdd47a103f3adbbb92ce0b416af6eec8b242d12a9daa02306c75f415f3739384a34a32b7f57ff0023e5a729539468c25cbdfe7aff0091c668ccb040efd337b2246a4fdd507a7f21f8572dacc022d55e751b7ed11173df2df2e7fc7f1aded5266b5d64c31102d64b93329c1ea71b81ff003deb06eaf61943b48c15a3b726204fdf62ca08c7d39fcabd3c2425ed1545d51ebe0e12f69ed57da4624aaf966e0f3cfeb52dd2954419184381f2f3d05432c81d9f039dd525e3670dcfcc7238ed815eb3bdd1ec6ba1108df7a32fca4fcd9f6ab3be7ff9eaf4e28c90db3908721bd39edf851bff00d95ffbed6
|
|
|
|
expectedOutput: "Found 0 tags.\n",
|
|
|
|
recipeConfig: [
|
|
|
|
{
|
|
|
|
op: "From Hex",
|
2017-05-08 16:45:42 +00:00
|
|
|
args: ["None"]
|
2017-04-29 19:44:39 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
op: "Extract EXIF",
|
|
|
|
args: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]);
|