New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roy inspect custom signatures #108

Closed
ross-spencer opened this Issue Nov 1, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@ross-spencer
Contributor

ross-spencer commented Nov 1, 2017

Hi Richard,

I tried to inspect this following custom signature I added using Roy (the signature is for identifying HFS disk images):

	<?xml version="1.0" encoding="UTF-8"?>
	<FFSignatureFile xmlns="http://www.nationalarchives.gov.uk/pronom/SignatureFile" Version="1" DateCreated="2017-10-25T11:10:16+01:00">
	  <InternalSignatureCollection>
	  <InternalSignature ID="1" Specificity="Specific">
	  <ByteSequence Reference="BOFoffset">
		<SubSequence MinFragLength="23" Position="1" SubSeqMaxOffset="1024" SubSeqMinOffset="1024">
		  <Sequence>000000</Sequence>
		  <DefaultShift>4</DefaultShift>
		  <Shift Byte="00">1</Shift>
		  <LeftFragment MaxOffset="0" MinOffset="0" Position="1">02</LeftFragment>
		  <LeftFragment MaxOffset="0" MinOffset="0" Position="1">08</LeftFragment>
		  <LeftFragment MaxOffset="0" MinOffset="0" Position="2">0000</LeftFragment>
		  <LeftFragment MaxOffset="4" MinOffset="4" Position="3">0003</LeftFragment>
		  <LeftFragment MaxOffset="1" MinOffset="1" Position="4">0000</LeftFragment>
		  <LeftFragment MaxOffset="0" MinOffset="0" Position="5">01</LeftFragment>
		  <LeftFragment MaxOffset="0" MinOffset="0" Position="5">08</LeftFragment>
		  <LeftFragment MaxOffset="8" MinOffset="8" Position="6">4244</LeftFragment>
		  <RightFragment MaxOffset="1" MinOffset="1" Position="1">0000</RightFragment>
		  <RightFragment MaxOffset="1" MinOffset="1" Position="2">0000</RightFragment>
		</SubSequence>
	  </ByteSequence>
	</InternalSignature>
	</InternalSignatureCollection>
	<FileFormatCollection>
	  <FileFormat ID="1" Name="HFS-Dev-Sig-3" PUID="hfs/1" Version="1.0" MIMEType="application/hfs">
		<InternalSignatureID>1</InternalSignatureID>
		<Extension>img</Extension>
	  </FileFormat>
	</FileFormatCollection></FFSignatureFile>

Should that be possible at all? - Currently in Linux I just get a blank line output. (The signature works well in Siegfried).

@richardlehane

This comment has been minimized.

Show comment
Hide comment
@richardlehane

richardlehane Nov 1, 2017

Owner

Hi Ross,
tldr try a command like: roy inspect -extend hfs-dev-sig-3.xml hfs/1

Long version: when you use roy inspect to inspect formats it uses as input the source XML files (normally the droid XML file and/or the harvested PRONOM XML files) rather than your compiled signature (.sig) file. (This is because once signatures are compiled they are kind of shredded up for inserting in the search trees & pretty difficult to reconstruct). So to inspect a custom signature you need to use the same -extend or -extendc flags (if a container signature) you would use to build the signature file in order to tell roy where it can find your custom source file.

E.g. like:

image

Owner

richardlehane commented Nov 1, 2017

Hi Ross,
tldr try a command like: roy inspect -extend hfs-dev-sig-3.xml hfs/1

Long version: when you use roy inspect to inspect formats it uses as input the source XML files (normally the droid XML file and/or the harvested PRONOM XML files) rather than your compiled signature (.sig) file. (This is because once signatures are compiled they are kind of shredded up for inserting in the search trees & pretty difficult to reconstruct). So to inspect a custom signature you need to use the same -extend or -extendc flags (if a container signature) you would use to build the signature file in order to tell roy where it can find your custom source file.

E.g. like:

image

@richardlehane

This comment has been minimized.

Show comment
Hide comment
@richardlehane

richardlehane Nov 1, 2017

Owner

p.s. I'll make a change for the next release so that if roy can't find anything to inspect, rather than a blank line, it will return a more meaningful message like "I can't inspect {user input}! See roy inspect -help"

Owner

richardlehane commented Nov 1, 2017

p.s. I'll make a change for the next release so that if roy can't find anything to inspect, rather than a blank line, it will return a more meaningful message like "I can't inspect {user input}! See roy inspect -help"

@ross-spencer

This comment has been minimized.

Show comment
Hide comment
@ross-spencer

ross-spencer Nov 1, 2017

Contributor
Contributor

ross-spencer commented Nov 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment