diff --git a/src/MiniDocs/FileLocator.extension.st b/src/MiniDocs/FileLocator.extension.st index 2ea48bb..939380e 100644 --- a/src/MiniDocs/FileLocator.extension.st +++ b/src/MiniDocs/FileLocator.extension.st @@ -23,6 +23,30 @@ FileLocator class >> atAlias: aString put: aFolderOrFile [ ^ updatedAliases ] +{ #category : #'*MiniDocs' } +FileLocator >> extractMetadata [ +"I package the functionality from [[How to extract meta information using ExifTool]], +from the GToolkit Book. +I depend on the external tool ExifTool." + + | process variablesList | + process := GtSubprocessWithInMemoryOutput new + command: 'exiftool'; + arguments: { self fullName}. + process errorBlock: [ :proc | ^ self error: 'Failed to run exiftool' ]. + process runAndWait. + variablesList := process stdout lines collect: [ :currentLine | + | separatorIndex name value | + separatorIndex := currentLine indexOf: $:. + name := (currentLine copyFrom: 1 to: separatorIndex - 1) trimBoth. + value := (currentLine + copyFrom: separatorIndex + 1 + to: currentLine size) trimBoth. + name -> value + ]. + ^ variablesList asOrderedDictionary +] + { #category : #'*MiniDocs' } FileLocator class >> fileAliases [ ^ MiniDocs appFolder / 'fileAliases.ston'