snoopdave commented on code in PR #327:
URL: https://github.com/apache/roller/pull/327#discussion_r4636770447


##########
app/src/main/java/org/apache/roller/weblogger/pojos/MediaFile.java:
##########
@@ -366,6 +370,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 status using the current pixel 
limit, although thumbnail creation was decided at upload time. If the limit is 
later raised, a file stored without an `_sm` thumbnail is treated as having 
one; the views request `?t=true`, and the servlet serves the full original. 
Record whether thumbnail generation was skipped and use that state in the views 
and servlet. Please test a limit change 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]

Reply via email to