4 Commits
v5.1 ... v5.2

Author SHA1 Message Date
fd893d8c4e pom.xml: Release version 5.2 2020-08-06 16:16:13 +03:00
2263ac27e8 src/main/java: Handle more corner cases in FixJpgJpgThumbnails.java
We should make sure we are catching .JPG and .jpg. Also, we should
check for Generated Thumbnails as well as IM Thumbnail.
2020-08-06 16:13:51 +03:00
cf7012d698 pom.xml: Change version to 5.2-SNAPSHOT 2020-08-06 16:13:27 +03:00
7edc60e6ca README.md: Use badge for dspace5 branch 2020-08-06 15:47:33 +03:00
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# CGSpace Java Helpers [![Build Status](https://travis-ci.org/ilri/cgspace-java-helpers.svg?branch=master)](https://travis-ci.org/ilri/dspace-curation-tasks) # CGSpace Java Helpers [![Build Status](https://travis-ci.org/ilri/cgspace-java-helpers.svg?branch=dspace5)](https://travis-ci.org/ilri/dspace-curation-tasks)
DSpace curation tasks and other Java-based helpers used on the [CGSpace](https://cgspace.cgiar.org) institutional repository: DSpace curation tasks and other Java-based helpers used on the [CGSpace](https://cgspace.cgiar.org) institutional repository:
- **CountryCodeTagger**: add ISO 3166-1 Alpha2 country codes to items based on their existing country metadata - **CountryCodeTagger**: add ISO 3166-1 Alpha2 country codes to items based on their existing country metadata

View File

@ -6,7 +6,7 @@
<groupId>io.github.ilri.cgspace</groupId> <groupId>io.github.ilri.cgspace</groupId>
<artifactId>cgspace-java-helpers</artifactId> <artifactId>cgspace-java-helpers</artifactId>
<version>5.1</version> <version>5.2</version>
<name>cgspace-java-helpers</name> <name>cgspace-java-helpers</name>
<url>https://github.com/ilri/cgspace-java-helpers</url> <url>https://github.com/ilri/cgspace-java-helpers</url>

View File

@ -79,7 +79,7 @@ public class FixJpgJpgThumbnails {
for (Bitstream thumbnailBitstream : thumbnailBundleBitstreams) { for (Bitstream thumbnailBitstream : thumbnailBundleBitstreams) {
String thumbnailName = thumbnailBitstream.getName(); String thumbnailName = thumbnailBitstream.getName();
if (thumbnailName.contains(".jpg.jpg")) { if (thumbnailName.toLowerCase().contains(".jpg.jpg")) {
Bundle[] originalBundles = item.getBundles("ORIGINAL"); Bundle[] originalBundles = item.getBundles("ORIGINAL");
for (Bundle originalBundle : originalBundles) { for (Bundle originalBundle : originalBundles) {
Bitstream[] originalBundleBitstreams = originalBundle.getBitstreams(); Bitstream[] originalBundleBitstreams = originalBundle.getBitstreams();
@ -88,7 +88,7 @@ public class FixJpgJpgThumbnails {
String originalName = originalBitstream.getName(); String originalName = originalBitstream.getName();
//check if the original file name is the same as the thumbnail name minus the extra ".jpg" //check if the original file name is the same as the thumbnail name minus the extra ".jpg"
if (originalName.equals(StringUtils.removeEndIgnoreCase(thumbnailName, ".jpg")) && "Generated Thumbnail".equals(thumbnailBitstream.getDescription())) { if (originalName.equalsIgnoreCase(StringUtils.removeEndIgnoreCase(thumbnailName, ".jpg")) && ("Generated Thumbnail".equals(thumbnailBitstream.getDescription()) || "IM Thumbnail".equals(thumbnailBitstream.getDescription()))) {
System.out.println(item.getHandle() + ": replacing " + thumbnailName + " with " + originalName); System.out.println(item.getHandle() + ": replacing " + thumbnailName + " with " + originalName);
//add the original bitstream to the THUMBNAIL bundle //add the original bitstream to the THUMBNAIL bundle