When running ImageFap v1.0 the sequence number used to dynamically build a file's name is reset to 1 for each new page of images of a same gallery that is visited by the program.
The result being that some or all of the previous page's files will be overwritten each time a new page is processed for that same gallery.
Page 1's 00001.jpg gets overwritten by page 2's 00001.jpg and so on ...
I looked at the code and modified the GalleryLoader.java source file to get around this problem.
OLD CODE ---------------------------------------------
System.out.println(" +G Started parsing gallery "+ title +"...");
for (int page = 0; parseGallery(page); ++page);
System.out.println(" -G Finished parsing gallery "+ title +".");
NEW CODE ---------------------------------------------
System.out.println(" +G Started parsing gallery "+ title +"...");
boolean _Continue = true;
int _PictureCount = 0;
int _Page = 0;
while (_Continue == true)
{
_PictureCount = parseGallery(_Page,_PictureCount);
if (_PictureCount > 0)
{
++_Page;
}
else
{
_Continue = false;
}
}
System.out.println(" -G Finished parsing gallery "+ title +".");
OLD CODE ---------------------------------------------
private boolean parseGallery(int page) { try {
NEW CODE ---------------------------------------------
private int parseGallery(int page,int picturecount) { try {
OLD CODE ---------------------------------------------
int number = 0;
NEW CODE ---------------------------------------------
int number = picturecount;
OLD CODE ---------------------------------------------
/* Gibt es noch eine weitere Seite
*/
Matcher nextMatcher = nextPattern.matcher(answerStr);
return nextMatcher.find();
/* Ausnahmen abfangen
*/
} catch (IllegalStateException e) {
System.err.println("Es konnte kein Muster gefunden werden was darauf hinweist, dass das Design veraendert wurde");
e.printStackTrace();
System.exit(1);
return false;
} catch (UnknownHostException e) {
e.printStackTrace();
return false;
} catch (MalformedURLException e) {
e.printStackTrace();
return false;
} catch (IOException e) {
e.printStackTrace();
return false;
NEW CODE ---------------------------------------------
/* Gibt es noch eine weitere Seite
*/
Matcher nextMatcher = nextPattern.matcher(answerStr);
if (nextMatcher.find() == false)
{
number = -1; // Stop attempting to process pages of this gallery.
}
return number;
/* Ausnahmen abfangen
*/
} catch (IllegalStateException e) {
System.err.println("Es konnte kein Muster gefunden werden was darauf hinweist, dass das Design veraendert wurde");
e.printStackTrace();
System.exit(1);
return -1;
} catch (UnknownHostException e) {
e.printStackTrace();
return -1;
} catch (MalformedURLException e) {
e.printStackTrace();
return -1;
} catch (IOException e) {
e.printStackTrace();
return -1;
I will upload my modified version of the GalleryLoader.java file. Note that I also made some cosmetic changes to the output messages, but those cosmetic changes are not needed to correct the problem described here.
Only the code changes listed above were needed, to correct the problem.
Thanks,
marc.savereux@xaro.com
Alternate GalleryLoader.java for ImageFap.class