snoopdave commented on code in PR #315:
URL: https://github.com/apache/roller/pull/315#discussion_r4636768804
##########
app/src/main/java/org/apache/roller/weblogger/pojos/MediaFile.java:
##########
@@ -367,6 +371,46 @@ public String getThumbnailURL() {
.getMediaFileThumbnailURL(getWeblog(), this.getId(), true);
}
+ /**
+ * True for an image whose recorded size is over
uploads.thumbnail.maxPixels.
+ * Such images are stored without a thumbnail.
+ */
+ public boolean isOverThumbnailPixelLimit() {
+ if (!isImageFile() || getWidth() <= 0 || getHeight() <= 0) {
+ return false;
+ }
+ return (long) getWidth() * getHeight() > thumbnailMaxPixels();
Review Comment:
**Important:** This recalculates thumbnail availability using the current
setting, but thumbnail creation happened at upload time. If the setting
changes, an existing file can be marked as lacking a thumbnail when `_sm`
exists, or marked as having one when it does not; previews can then use the
full original. Derive availability from the stored thumbnail state and test
changing the limit after upload.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]