Permalink
Browse files

Merge branch 'master' of git://github.com/nzakas/cssembed into max-im…

…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...
2 parents 6c7d9a7 + 790b69a commit 8f690982f376cfa1df691454e5183d5b90c7679d @tivac tivac committed Apr 25, 2011
Showing with 15 additions and 21 deletions.
  1. +8 −1 CHANGELOG
  2. +0 −15 README
  3. +5 −5 src/net/nczonline/web/cssembed/CSSEmbed.java
  4. +2 −0 tests/net/nczonline/web/cssembed/CSSURLEmbedderTest.java
View
9 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
View
15 README
@@ -9,21 +9,6 @@ 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
-------------------------------------------------------------------------------
View
10 src/net/nczonline/web/cssembed/CSSEmbed.java
@@ -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 {
@@ -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
@@ -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.");
}
-}
+}
View
2 tests/net/nczonline/web/cssembed/CSSURLEmbedderTest.java
@@ -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", " ");

0 comments on commit 8f69098

Please sign in to comment.