From 3f8ebf45aee528ac3716e47affc0c2ecedf46251 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Paour Date: Sun, 13 Oct 2002 11:03:28 +0000 Subject: [PATCH] Added setCaptionsWithFilenames property. Added support for resizing based on album's autoResize property. --- com/gallery/GalleryRemote/model/Picture.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/com/gallery/GalleryRemote/model/Picture.java b/com/gallery/GalleryRemote/model/Picture.java index 2e6f9c3..4114d94 100644 --- a/com/gallery/GalleryRemote/model/Picture.java +++ b/com/gallery/GalleryRemote/model/Picture.java @@ -65,6 +65,10 @@ public Picture( File source ) { public void setSource( File source ) { this.source = source; + if (GalleryRemote.getInstance().properties.getBooleanProperty("setCaptionsWithFilenames")) { + setCaption(source.getName()); + } + fileSize = -1; } @@ -108,7 +112,21 @@ public File getUploadSource() { if ( GalleryRemote.getInstance().properties.getBooleanProperty("resizeBeforeUpload") ) { Dimension d = GalleryRemote.getInstance().properties.getDimensionProperty("resizeTo"); - return ImageUtils.resize( getSource().getPath(), d ); + if ( d == null || d.equals( new Dimension( 0, 0 ) ) ) { + d = null; + album.fetchAlbumProperties(null); + int l = album.getServerAutoResize(); + + if ( l != 0 ) { + d = new Dimension( l, l ); + } + } + + if ( d != null ) { + return ImageUtils.resize( getSource().getPath(), d ); + } else { + return getSource(); + } } else { return getSource(); }