Esempio n. 1
0
static void findImages (const Project::Item& item, OwnedArray<Project::Item>& found)
{
    if (item.isImageFile())
    {
        found.add (new Project::Item (item));
    }
    else if (item.isGroup())
    {
        for (int i = 0; i < item.getNumChildren(); ++i)
            findImages (item.getChild (i), found);
    }
}
Esempio n. 2
0
void IconSet::findImages(const String& baseDir, const String& sourceDir, Array<Source>& sourceArray) {
    Array<String> filenameArray;
    FileSystem::getFiles(pathConcat(pathConcat(baseDir, sourceDir), "*"), filenameArray);
    for (int i = 0; i < filenameArray.size(); ++i) {
        if (Image::fileSupported(filenameArray[i])) {
            String f = pathConcat(sourceDir, filenameArray[i]);
            shared_ptr<Image> im = Image::fromFile(pathConcat(baseDir, f));
            Source& s = sourceArray.next();
            s.filename = f;
            s.width    = im->width();
            s.height   = im->height();
            // todo (Image upgrade): find replacement calculation for channels
            //s.channels = im.channels;
        }
    }

    Array<String> dirArray;
    FileSystem::getDirectories(pathConcat(pathConcat(baseDir, sourceDir), "*"), dirArray);
    for (int i = 0; i < dirArray.size(); ++i) {
        if (dirArray[i] != ".svn" && dirArray[i] != "CVS") {
            findImages(baseDir, pathConcat(sourceDir, dirArray[i]), sourceArray);
        }
    }
}
Esempio n. 3
0
void Project::findAllImageItems (OwnedArray<Project::Item>& items)
{
    findImages (getMainGroup(), items);
}
Esempio n. 4
0
AlbumArtImages::AlbumArtImages(Metadata *metadata)
    : m_parent(metadata)
{
    findImages();
}