Skip to content

Commit

Permalink
2004-04-20 Pierre-Luc Paour <gallery@paour.com> (1.4-b3)
Browse files Browse the repository at this point in the history
	* When ImageMagick is not available, resize before upload
	  uses Java 1.4 ImageIO to resize the image. This might cause
	  OutOfMemoryErrors in some cases; I'm trying to reproduce.
	  It also causes the EXIF information to be lost. I'm trying to find
	  a way to fix this, but the ImageIO classes (java 1.4) are pretty
	  broken.
	* Disabled Save and Open until we know how we're going
	  to handle saving and loading.
	* Merged changes from 1.3 branch.
	* Applets now work even if Gallery is in (unsupported)
	  relative mode (album and gallery URLs are relative)
	* Allowing ImageMagick and Jpegtran settings to be overriden
	  in the general settings (beware, the format of these files has
	  consequently changed).
  • Loading branch information
Pierre-Luc Paour committed Apr 20, 2004
1 parent c9141f1 commit 44d4033
Show file tree
Hide file tree
Showing 32 changed files with 784 additions and 261 deletions.
54 changes: 54 additions & 0 deletions ChangeLog
@@ -1,3 +1,20 @@
2004-04-20 Pierre-Luc Paour <gallery@paour.com> (1.4-b3)

* When ImageMagick is not available, resize before upload
uses Java 1.4 ImageIO to resize the image. This might cause
OutOfMemoryErrors in some cases; I'm trying to reproduce.
It also causes the EXIF information to be lost. I'm trying to find
a way to fix this, but the ImageIO classes (java 1.4) are pretty
broken.
* Disabled Save and Open until we know how we're going
to handle saving and loading.
* Merged changes from 1.3 branch.
* Applets now work even if Gallery is in (unsupported)
relative mode (album and gallery URLs are relative)
* Allowing ImageMagick and Jpegtran settings to be overriden
in the general settings (beware, the format of these files has
consequently changed).

2004-03-18 Pierre-Luc Paour <gallery@paour.com> (1.4-b2)

* Integrated Marc Pawliger's patch that reads the default
Expand All @@ -21,6 +38,43 @@

Some functionality broken, DO NOT USE THIS VERSION, stay on BRANCH_GR_1_3

2004-04-15 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b11)

* No longer resizing up (upsampling) images that are smaller than
the album maximum size on upload.

2004-04-12 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b10)

* Parentheses are invalid in album names.
* GR now honors hidden images and read permissions for albums.

2004-03-25 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b9)

* On Java 1.4.2 and later, reading proxy from Java plugin in
applet mode.

2004-03-15 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b8)

* Fixed a bug in the applet uploader, where added pictures were
not shown.
* From this version on, the applets are signed with a certificate
authneticated by Thawte.

This is considered a final candidate for GR 1.3.2.

2004-02-27 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b7)

* Added support for Basic auth username and password embedded in
URL, such as http://user:pass@server/path/. This is obviously
an insecure way of storing passwords. Thanks to Mindstorm for
letting me test on his server.
* Fixed a bunch of niggles with the Auth dialog.
* Added flushing of the JTree when adding a new
album. It's better than fetching the albums again from the server
but it loses album state. I spent two days trying to debug this
but I can't crack this problem of the JTree not refreshing.
Help needed!

2004-02-25 Pierre-Luc Paour <gallery@paour.com> (1.3.2-b6)

* Solved a very long-standing problem where I didn't know how
Expand Down
5 changes: 3 additions & 2 deletions build.xml
Expand Up @@ -240,7 +240,7 @@
<target name="installer_macosx" depends="executable_macosx, docs"
description="Build a MacOSX package">

<tar destfile="GalleryRemote.${version}.MacOSX.NoVM.tgz" compression="gzip">
<tar destfile="GalleryRemote.MacOSX.NoVM.tgz" compression="gzip">
<tarfileset dir="." prefix="Gallery Remote">
<include name="Gallery Remote.app/**"/>
<exclude name="Gallery Remote.app/Contents/MacOS/*"/>
Expand All @@ -261,7 +261,8 @@

<loadproperties srcfile="defaults.properties"/>

<move file="${install}/Windows/NoVM/InstallGalleryRemote.exe" tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
<move file="${install}/Windows/NoVM/InstallGalleryRemote.exe"
tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
<move file="${install}/Windows/VM/InstallGalleryRemote.exe" tofile="${install}/staging/GalleryRemote.${version}.Win32.VM.exe"/>
<!--move file="${install}/MacOSX/InstallGalleryRemote.zip" tofile="${install}/staging/GalleryRemote.${version}.MacOSX.NoVM.zip"/-->
<move file="${install}/Linux/NoVM/InstallGalleryRemote.bin" tofile="${install}/staging/GalleryRemote.${version}.Linux.NoVM.bin"/>
Expand Down
24 changes: 17 additions & 7 deletions com/gallery/GalleryRemote/AuthorizePopup.java
Expand Up @@ -27,6 +27,9 @@ public class AuthorizePopup implements HTTPClient.AuthorizationPrompter {
private static BasicAuthBox inp = null;
public static final String MODULE = "AuthorizePopup";

public static String hackUsername = null;
public static String hackPassword = null;


/**
* Engage this class to be the authorization popup
Expand All @@ -46,6 +49,14 @@ public static void enable() {
*/
public NVPair getUsernamePassword(HTTPClient.AuthorizationInfo challenge,
boolean forProxy) {

// The HTTPClient library doesn't correctly accept setting auth params
// ahead of time (because it can't accept a realm of *
// so we have to do it this hackish way...
if (challenge.getScheme().equalsIgnoreCase("Basic") && hackUsername != null) {
return new NVPair(hackUsername, hackPassword);
}

String line1;
String line2;
String line3;
Expand All @@ -55,11 +66,10 @@ public NVPair getUsernamePassword(HTTPClient.AuthorizationInfo challenge,
line2 = challenge.getHost();
line3 = GRI18n.getString(MODULE, "authMthd");
} else {
line1 = GRI18n.getString(MODULE, "enterUsrPwdRealm") +
challenge.getRealm() + "'";
line2 = GRI18n.getString(MODULE, "onHost") + challenge.getHost() + ":" +
challenge.getPort();
line3 = GRI18n.getString(MODULE, "authScheme") + challenge.getScheme();
line1 = GRI18n.getString(MODULE, "enterUsrPwdRealm", new Object[] { challenge.getRealm() });
line2 = GRI18n.getString(MODULE, "onHost", new Object[] { challenge.getHost() + ":" +
challenge.getPort()});
line3 = GRI18n.getString(MODULE, "authScheme", new Object[] { challenge.getScheme() });
}

synchronized (getClass()) {
Expand All @@ -82,7 +92,7 @@ public NVPair getUsernamePassword(HTTPClient.AuthorizationInfo challenge,
* @created February 2, 2003
*/
private static class BasicAuthBox extends JDialog implements ActionListener {
private final static String title = GRI18n.getString(MODULE, "authReq");
private final static String title = GRI18n.getString(MODULE, "authreq");
private JLabel line1, line2, line3;
private JTextField user, pass;
private int done;
Expand Down Expand Up @@ -178,7 +188,7 @@ NVPair getInput(String l1, String l2, String l3,
setResizable(false);
// put popup at upper right of the parent frame (assuming we have one)

DialogUtil.center(getOwner());
DialogUtil.center(this, getOwner());

boolean user_focus = true;
if (scheme.equalsIgnoreCase("NTLM")) {
Expand Down
68 changes: 36 additions & 32 deletions com/gallery/GalleryRemote/CoreUtils.java
Expand Up @@ -145,51 +145,55 @@ public Component getListCellRendererComponent(
super.getListCellRendererComponent(list, value, index, selected, hasFocus);

Album currentAlbum = core.getCurrentAlbum();
if ( null != currentAlbum
if ( null != currentAlbum
&& null != value
&& -1 != index) {

Picture p = currentAlbum.getPicture(index);
try {
Picture p = currentAlbum.getPicture(index);

if (p.isOnline()) {
if (p.getParentAlbum() != p.getAlbumOnServer()
|| p.getIndex() != p.getIndexOnServer()) {
setForeground(Color.red);
if (p.isOnline()) {
if (p.getParentAlbum() != p.getAlbumOnServer()
|| p.getIndex() != p.getIndexOnServer()) {
setForeground(Color.red);
} else {
setForeground(Color.green);
}
} else {
setForeground(Color.green);
//setForeground(Color.black);
}
} else {
//setForeground(Color.black);
}

if (GalleryRemote._().properties.getShowThumbnails()) {
ImageIcon icon = core.getThumbnail(p);
if (icon != null) {
setIcon(icon);
setIconTextGap(4 + GalleryRemote._().properties.getThumbnailSize().width - icon.getIconWidth());
if (GalleryRemote._().properties.getShowThumbnails()) {
ImageIcon icon = core.getThumbnail(p);
if (icon != null) {
setIcon(icon);
setIconTextGap(4 + GalleryRemote._().properties.getThumbnailSize().width - icon.getIconWidth());
}
}
}

StringBuffer text = new StringBuffer();
text.append("<html><p>");
StringBuffer text = new StringBuffer();
text.append("<html><p>");

if (p.isOnline()) {
text.append(p.getName());
} else {
File f = p.getSource();
text.append(f.getName());
if (GalleryRemote._().properties.getShowPath()) {
text.append(" [").append(f.getParent()).append("]</p>");
if (p.isOnline()) {
text.append(p.getName());
} else {
File f = p.getSource();
text.append(f.getName());
if (GalleryRemote._().properties.getShowPath()) {
text.append(" [").append(f.getParent()).append("]</p>");
}
}
}

if (p.getCaption() != null && getIcon() != null) {
text.append("<p><font color=\"gray\">").append(p.getEscapedCaption()).append("</font></p>");
}
if (p.getCaption() != null && getIcon() != null) {
text.append("<p><font color=\"gray\">").append(p.getEscapedCaption()).append("</font></p>");
}

text.append("</html>");
//Log.log(Log.TRACE, MODULE, text.toString());
setText(text.toString());
text.append("</html>");
//Log.log(Log.TRACE, MODULE, text.toString());
setText(text.toString());
} catch (Exception e) {
setText("Problem...");
}
} else {
setText("dummy");
}
Expand Down
17 changes: 15 additions & 2 deletions com/gallery/GalleryRemote/GRApplet.java
Expand Up @@ -8,6 +8,7 @@
import java.applet.Applet;
import java.io.FilePermission;
import java.net.URL;
import java.net.MalformedURLException;

import HTTPClient.CookieModule;
import HTTPClient.Cookie;
Expand Down Expand Up @@ -106,8 +107,20 @@ protected AppletInfo getGRAppletInfo() {
if (cookieDomain == null || cookieDomain.length() < 1) {
try {
cookieDomain = new URL(url).getHost();
} catch (Exception e) {
Log.logException(Log.LEVEL_ERROR, MODULE, e);
} catch (MalformedURLException e) {
//Log.logException(Log.LEVEL_ERROR, MODULE, e);
URL documentBase = getDocumentBase();
cookieDomain = documentBase.getHost();

Log.log(Log.LEVEL_INFO, MODULE, "URL probably doesn't have a host part because the Gallery " +
"is in (unsupported) relative mode. Using the Applet documentBase: " + cookieDomain);

try {
url = new URL(documentBase.getProtocol(), documentBase.getHost(), documentBase.getPort(),
url).toString();
} catch (MalformedURLException e1) {
Log.logException(Log.LEVEL_ERROR, MODULE, e1);
}
}
}

Expand Down

0 comments on commit 44d4033

Please sign in to comment.