Ignore:
Timestamp:
12/10/13 14:23:00 (11 years ago)
Author:
ngw8
Message:

Added support for the CSS 'background-size' property to WebParser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/ItemUtils.java

    r592 r600  
    367367                        }
    368368
    369                         // try images subdirectory
    370                         File file = null;
    371 
    372                         for (String dir : org.expeditee.settings.UserSettings.ImageDirs) {
    373                                 file = new File(dir + path);
    374                                 if (file.exists() && !file.isDirectory())
    375                                         break;
    376                         }
    377 
    378                         if (file == null || !file.exists() || file.isDirectory())
    379                                 file = new File(path);
    380 
    381                         // try relative path
    382                         if (!file.exists() || file.isDirectory()) {
    383                                 URL picture = new Object().getClass().getResource(path);
    384 
    385                                 // decode to remove %20 in windows folder names
    386                                 if (picture != null) {
    387                                         try {
    388                                                 path = URLDecoder.decode(picture.getFile(), "UTF-8");
    389                                         } catch (UnsupportedEncodingException e) {
    390                                                 // TODO Auto-generated catch block
    391                                                 e.printStackTrace();
    392                                         }
    393                                 }
    394 
    395                         } else
    396                                 path = file.getPath();
    397 
    398                         // if the image isn't found by now, give up.
    399                         file = new File(path);
    400                         if (!file.exists() || file.isDirectory()) {
    401                                 return null;
    402                         }
    403 
    404369                } catch (Exception e) {
    405370                        return null;
Note: See TracChangeset for help on using the changeset viewer.