Skip to content

Commit

Permalink
Insert the 80x15 version of Creative Commons License badges
Browse files Browse the repository at this point in the history
  • Loading branch information
kwcoffman committed Jul 22, 2010
1 parent 1e491fb commit 88bb9fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/edu/umich/med/umms/CitationManipulate.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CitationManipulate {
private static final Pattern LIC_PATTERN = Pattern.compile(LIC_EXP);

private static final String CC_LIC_LOC = "http://i.creativecommons.org/l/";
private static final String CC_BADGE_IMG_NAME = "88x31.png";
private static final String CC_BADGE_IMG_NAME = "80x15.png";

private ArrayList<String> foundURLs = new ArrayList<String>();
private Matcher urlMatcher;
Expand Down
13 changes: 9 additions & 4 deletions src/edu/umich/med/umms/DecompUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,17 @@ public static Point calculateCitationTextPosition(XShape xOrigImage, XShape xCit
// Assumes that the original image shape is supplied
public static Size calculateCitationImageSize(XShape xOrigImage)
{
Point aPos = xOrigImage.getPosition();
Size aSize = xOrigImage.getSize();
// Using the original size results in an invalid shape!
//Size aSize = xOrigImage.getSize();
Size citationSize = new Size();

citationSize.Width = 88 * 20; // Image is 88x31 pixels -- show it 20 times that size
citationSize.Height = 31 * 20;
// This assumes the original image is 80x15 pixels
// According to http://www.unitconversion.org//typography/pixels-x-to-millimeters-conversion.html
// one pixel == 0.26458333333333 mm
// So...

citationSize.Width = Math.round((float)80 * (float)26.45833);
citationSize.Height = Math.round((float)15 * (float)26.45833);
return citationSize;
}

Expand Down

0 comments on commit 88bb9fa

Please sign in to comment.