Skip to content

Commit

Permalink
importConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers authored and haarli committed Jul 25, 2024
1 parent d5f1385 commit 82bc828
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
* @author Leonid Andreev
*/
public class ImageThumbConverter {
public static String THUMBNAIL_SUFFIX = "thumb";
public static String THUMBNAIL_MIME_TYPE = "image/png";
public static String THUMBNAIL_FILE_EXTENSION = ".png";

public static int DEFAULT_CARDIMAGE_SIZE = 48;
public static int DEFAULT_THUMBNAIL_SIZE = 64;
public static int DEFAULT_DATASETLOGO_SIZE = 140;
public static int DEFAULT_PREVIEW_SIZE = 400;
public static final String THUMBNAIL_SUFFIX = "thumb";
public static final String THUMBNAIL_MIME_TYPE = "image/png";
public static final String THUMBNAIL_FILE_EXTENSION = ".png";

public static final int DEFAULT_CARDIMAGE_SIZE = 48;
public static final int DEFAULT_THUMBNAIL_SIZE = 64;
public static final int DEFAULT_DATASETLOGO_SIZE = 140;
public static final int DEFAULT_PREVIEW_SIZE = 400;

private static final Logger logger = Logger.getLogger(ImageThumbConverter.class.getCanonicalName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public static DatasetThumbnail getThumbnail(Dataset dataset, DatasetVersion data
return null;
}

if (size == 0) {
//Size 0 will fail (and set the failure flag) and should never be sent
logger.warning("getThumbnail called with size 0");
return null;
}
StorageIO<Dataset> dataAccess = null;

try{
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
</ui:define>
<ui:define name="og_header">
<ui:fragment rendered="#{!DatasetPage.anonymizedAccess}">
<o:importConstants type="edu.harvard.iq.dataverse.dataaccess.ImageThumbConverter" />
<meta property="og:title" content="#{DatasetPage.title}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="#{DatasetPage.dataverseSiteUrl}/dataset.xhtml?persistentId=#{dataset.globalId}" />
Expand Down

0 comments on commit 82bc828

Please sign in to comment.