Open
Conversation
ritschwumm
requested changes
Jan 5, 2019
| } | ||
|
|
||
| private def dimensions(format:String):String = { | ||
| ".*; (\\d+) x (\\d+) cm ;.*".r.findAllMatchIn(format).foreach { m => |
Owner
There was a problem hiding this comment.
a bit more tricvky, but there's should be a way to get rid of the early return
| val historyIndex = fullDescription.indexOf(historyMarker) | ||
| val format = text(dc \ "format").replaceAll("image/jpeg", "").trim() | ||
|
|
||
| return Some(new ImageData( |
Owner
There was a problem hiding this comment.
Some/None can be better be done with scutil's Boolean.option(trueValue)
Contributor
Author
There was a problem hiding this comment.
I don't understand, do you want me to write Boolean.option(new ImageData(... ? I get value option is not a member of object Boolean
Owner
There was a problem hiding this comment.
with import scutil.base.implicits_ you'll get this extension method https://github.com/ritschwumm/scutil/blob/master/modules/base/src/main/scala/scutil/lang/pimp/BooleanImplicits.scala#L16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for Open Archives Initiative Protocol for Metadata Harvesting, version 2.0.
This is a standard protocol used by several GLAM to share metadata about collections of images.
It is used in particular by the city archives of Toulouse, which released many contents in open data. It just allowed me to import a small fonds using Commonist: Fonds_Ludovic_Gaurier
I tried to make it reusable for others with a new properties file. To make it work, one or more XML files with OAI-PMH contents must be in the same directory than the images. Matching is performed on the filename without extension and the
dc:relationtag.This is the first time I ever code in Scala, so there are surely some things that could be written better. But it works :)