Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/nzakas/cssembed into max-im…
Browse files Browse the repository at this point in the history
…age-size

Conflicts:
	src/net/nczonline/web/cssembed/CSSEmbed.java
	src/net/nczonline/web/cssembed/CSSURLEmbedder.java
	tests/net/nczonline/web/cssembed/CSSURLEmbedderTest.java
  • Loading branch information
tivac committed Apr 25, 2011
2 parents 6c7d9a7 + 790b69a commit 8f69098
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG
@@ -1,5 +1,12 @@
CSSEmbed
Copyright (c) 2009-2001 Nicholas C. Zakas. All rights reserved.
Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.

0.3.6
* Allow specification of maximum data URI length (tivac and fearphage)
* Option to skip files that are missing (tivac)

0.3.5
* Allow input from STDIN.

0.3.4

Expand Down
15 changes: 0 additions & 15 deletions README
Expand Up @@ -8,21 +8,6 @@ Copyright (c) 2009 Nicholas C. Zakas. All rights reserved.
CSSEmbed is a small program/library to automate embedding of data URIs in
CSS files.

-------------------------------------------------------------------------------
Usage
-------------------------------------------------------------------------------

Usage: java -jar cssembed-x.y.z.jar [options] [input file]

Global Options
-h, --help Displays this information.
--charset <charset> Character set of the input file.
--mhtml Enable MHTML mode.
--mhtmlroot <root> Use <root> as the MHTML root for the file.
-v, --verbose Display informational messages and warnings.
--root <root> Prepends <root> to all relative URLs.
-o <file> Place the output into <file>. Defaults to stdout.

-------------------------------------------------------------------------------
License
-------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions src/net/nczonline/web/cssembed/CSSEmbed.java
Expand Up @@ -63,8 +63,8 @@ public static void main(String[] args) {
CmdLineParser.Option mhtmlOpt = parser.addBooleanOption("mhtml");
CmdLineParser.Option mhtmlRootOpt = parser.addStringOption("mhtmlroot");
CmdLineParser.Option skipMissingOpt = parser.addBooleanOption("skip-missing");
CmdLineParser.Option uriLengthOpt = parser.addIntegerOption('u', "maxuri");
CmdLineParser.Option imageSizeOpt = parser.addIntegerOption('i', "image-size");
CmdLineParser.Option uriLengthOpt = parser.addIntegerOption("max-uri-length");
CmdLineParser.Option imageSizeOpt = parser.addIntegerOption("max-image-size");

try {

Expand Down Expand Up @@ -152,7 +152,7 @@ public static void main(String[] args) {
options = options | CSSURLEmbedder.SKIP_MISSING_OPTION;
}

CSSURLEmbedder embedder = new CSSURLEmbedder(in, options, verbose, maxurilength, maximagesize);
CSSURLEmbedder embedder = new CSSURLEmbedder(in, options, verbose, uriLength, imageSize);
embedder.setMHTMLRoot(mhtmlRoot);

//close in case writing to the same file
Expand Down Expand Up @@ -243,7 +243,7 @@ private static void usage() {
+ " --root <root> Prepends <root> to all relative URLs.\n"
+ " --skip-missing Don't throw an error for missing image files.\n"
+ " --max-uri-length len Maximum length for a data URI. Defaults to 32768.\n"
+ " -i, --image-size Maximum image size (in bytes) to convert.\n"
+ " --max-image-size size Maximum image size (in bytes) to convert.\n"
+ " -o <file> Place the output into <file>. Defaults to stdout.");
}
}
}
2 changes: 2 additions & 0 deletions tests/net/nczonline/web/cssembed/CSSURLEmbedderTest.java
Expand Up @@ -140,6 +140,8 @@ public void testAbsoluteLocalFileWithMissingFilesEnabled() throws IOException {
assertEquals(code, result);
}



@Test
public void testAbsoluteLocalFileUnderMaxLength() throws IOException {
String filename = CSSURLEmbedderTest.class.getResource("folder.png").getPath().replace("%20", " ");
Expand Down

0 comments on commit 8f69098

Please sign in to comment.