Skip to content

Commit

Permalink
use any known image folder
Browse files Browse the repository at this point in the history
  • Loading branch information
rsehr committed Jun 26, 2020
1 parent 63cca36 commit b444f75
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions ImageQAPlugin/plugin_intranda_step_imageQA.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<!-- which projects to use for (can be more then one, otherwise use *) -->
<project>*</project>
<step>*</step>
<!-- which images to use -->
<useOrigFolder>true</useOrigFolder>
<!-- which images to use , possible values are master|main|jpeg|source|... -->
<foldername>master</foldername>
<!-- how to display the thumbnails -->
<numberOfImagesPerPage>12</numberOfImagesPerPage>
<thumbnailsize>200</thumbnailsize>
Expand Down Expand Up @@ -83,7 +83,7 @@
<step>MasterQA</step>
<step>DerivateQA</step>
<!-- which images to use -->
<useOrigFolder>true</useOrigFolder>
<foldername>master</foldername>
<!-- how to display the thumbnails -->
<numberOfImagesPerPage>12</numberOfImagesPerPage>
<thumbnailsize>200</thumbnailsize>
Expand Down Expand Up @@ -113,7 +113,7 @@
<config>
<project>*</project>
<step>ImageQA</step>
<useOrigFolder>true</useOrigFolder>
<foldername>master</foldername>
<!-- how to display the thumbnails -->
<numberOfImagesPerPage>12</numberOfImagesPerPage>
<thumbnailsize>200</thumbnailsize>
Expand Down
2 changes: 1 addition & 1 deletion ImageQAPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>de.intranda.goobi.workflow</groupId>
<artifactId>goobi-core-jar</artifactId>
<version>3.0.49</version>
<version>3.0.50-SNAPSHOT</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
Expand Down
27 changes: 14 additions & 13 deletions ImageQAPlugin/src/de/intranda/goobi/plugins/ImageQAPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.nio.file.Paths;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -193,20 +194,20 @@ public void initialize(Step step, String returnPath) {
}

initConfig(myconfig);

String imageFolder=null;

try {
String imageFolder;
if (myconfig.getBoolean("useOrigFolder", false)) {
imageFolder = step.getProzess().getImagesOrigDirectory(false);
} else {
imageFolder = step.getProzess().getImagesTifDirectory(false);
}
initImageList(myconfig, imageFolder);
this.useJSFullscreen = myconfig.getBoolean("useJSFullscreen", false);
this.noShortcutPrefix = myconfig.getBoolean("noShortcutPrefix", false);
this.thumbnailsOnly = myconfig.getBoolean("thumbnailsOnly", false);
} catch (SwapException | DAOException | IOException | InterruptedException e) {
imageFolder= step.getProzess().getConfiguredImageFolder(myconfig.getString("foldername","media"));
} catch (IOException | InterruptedException | SwapException | DAOException e) {
log.error(e);
}

initImageList(myconfig, imageFolder);
this.useJSFullscreen = myconfig.getBoolean("useJSFullscreen", false);
this.noShortcutPrefix = myconfig.getBoolean("noShortcutPrefix", false);
this.thumbnailsOnly = myconfig.getBoolean("thumbnailsOnly", false);

}

/**
Expand Down Expand Up @@ -305,7 +306,7 @@ public void initConfig(SubnodeConfiguration myconfig) {
THUMBNAIL_SIZE_IN_PIXEL = myconfig.getInt("thumbnailsize", 200);
THUMBNAIL_FORMAT = myconfig.getString("thumbnailFormat", "png");
MAINIMAGE_FORMAT = myconfig.getString("mainImageFormat", "jpg");
imageSizes = myconfig.getList("imagesize");
imageSizes = Arrays.asList(myconfig.getStringArray("imagesize"));
if (imageSizes == null || imageSizes.isEmpty()) {
imageSizes = new ArrayList<>();
}
Expand All @@ -314,7 +315,7 @@ public void initConfig(SubnodeConfiguration myconfig) {
tileSize = "";
}
/* load scale factors, set default of none found */
scaleFactors = myconfig.getList("scaleFactors");
scaleFactors = Arrays.asList(myconfig.getStringArray("scaleFactors"));
if (scaleFactors == null || scaleFactors.isEmpty()) {
scaleFactors = new ArrayList<>();
scaleFactors.add("1");
Expand Down

0 comments on commit b444f75

Please sign in to comment.