- if ( ! ( g_imagecache [ i ].i = IMG_Load ( fullpath ) ) ) {
- pnd_log ( pndn_error, "ERROR: Couldn't load static cache image: %s\n", fullpath );
- return ( 0 );
- }
+ if ( ! filename ) {
+ pnd_log ( pndn_error, "ERROR: (Try %u) Missing filename in conf for key: %s\n", try + 1, g_imagecache [ i ].confname );
+ if ( try == 0 ) { continue; } else { return ( 0 ); }
+ }
+
+ if ( filename [ 0 ] == '/' ) {
+ strncpy ( fullpath, filename, PATH_MAX );
+ } else {
+ sprintf ( fullpath, "%s/%s", basepath, filename );
+ }
+
+ if ( ( g_imagecache [ i ].i = IMG_Load ( fullpath ) ) ) {
+ break; // no retry needed
+ } else {
+ pnd_log ( pndn_error, "ERROR: (Try %u) Couldn't load static cache image: %s\n", try + 1, fullpath );
+ if ( try == 0 ) { continue; } else { return ( 0 ); }
+ }
+
+ } // try twice