mxp1988 / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
0 stars 0 forks source link

BasePath for saving EPUBs in "expanded" mode is wrong (Archive.java) // Patch included #255

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PROBLEM:

When using "subdir/expanded/ -mode exp -save" for validation of expanded EPUB 
archives and specifying a relative input path, the generated EPUB file isn't 
saved in the same directory as the input folder but is instead saved in the 
location of the epubcheck.jar

METHOD:

1. create directory "test/"
2. place epubcheck-tools inside
3. create subdirectory "subdir/" in "test/"
4. place an expanded (valid) epub in a subfolder named "expanded_epub/" in 
"subdir/"
5. validate the folder using "java -jar epubcheck-3.0.jar subdir/expanded/ 
-mode exp -save" from within the the "test/" directory

RESULT:

the saved EPUB is beeing stored in "test/expanded.epub"

EXPECTED:

the saved EPUB  should be stored in "test/subdir/expanded.epub"

PLATFORM:

* Mac OS X 10.8.3
* Java 1.6.0_43

ADDITIONAL INFO:

It's a bug in "com.adobe.epubcheck.util.Archive.java".
Line 34:

   epubFile = new File(epubName);

should be

   epubFile = new File(baseDir.getParent() + File.separator + epubName);

Original issue reported on code.google.com by tobias.c...@gmail.com on 15 Mar 2013 at 12:36

GoogleCodeExporter commented 8 years ago
Markus, Bogdan,
shall we handle this as a bug or a feature?

There might be use cases in which saving the EPUB archive in the current 
location is intended, but IMHO the generated archive should be placed in the 
same location as the expanded EPUB folder...

Original comment by tobias.c...@gmail.com on 23 Mar 2013 at 12:08

GoogleCodeExporter commented 8 years ago
As far as I can tell, this is a bug that should be fixed. Tobias, please go 
ahead and commit the patch. 

Original comment by markus.g...@gmail.com on 8 Apr 2013 at 9:55

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r457.

Original comment by tobias.c...@gmail.com on 9 Apr 2013 at 8:31

GoogleCodeExporter commented 8 years ago
Alright, issue is fixed in r457

Original comment by tobias.c...@gmail.com on 9 Apr 2013 at 8:32