Skip to content

Commit

Permalink
Added setCaptionsWithFilenames property.
Browse files Browse the repository at this point in the history
Added support for resizing based on album's autoResize property.
  • Loading branch information
Pierre-Luc Paour committed Oct 13, 2002
1 parent a2f3ee5 commit 3f8ebf4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion com/gallery/GalleryRemote/model/Picture.java
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 3f8ebf4

Please sign in to comment.