List all images under path

    @return unicode list
164874
def list_all_image(path, valid_exts=VALID_IMAGE_EXTS):
    
    for filename in os.listdir(path):
        bname, ext = os.path.splitext(filename)
        if ext.lower() not in VALID_IMAGE_EXTS:
            continue
        filepath = os.path.join(path, filename)
        yield strutils.decode(filepath)
665006
public function getImageAsString()
    {
        $data = null;
        ob_start();
        $this->show(true);
        $data = ob_get_contents();
        ob_end_clean();

        return $data;
    }
688051
public function getImages()
    {
        $images = array();

        $nodes = $this->html->findTags('img');
        foreach ($nodes as $node) {
            $source = trim($node->getAttribute('src'));

            if (empty($source)) {
                continue;
            }

            $url = $this->getAbsoluteUrl($source);
            $size = $this->getImageSize($url);

            if (is_array($size)) {
                list($width, $height) = $size;
            } else {
                continue;
            }

            if ($this->isImageAccepted($url, $width, $height)) {
                $images[] = array(
                    'url'    => $url,
                    'width'  => $width,
                    'height' => $height,
                    'area'   => ($width * $height)
                );
            }
        }

        return $images;
    }
1158
public function getResponsiveImagesDirectoryUrl(): string
    {
        return url($this->getBaseMediaDirectoryUrl().'/'.$this->pathGenerator->getPathForResponsiveImages($this->media)).'/';
    }
970889
public function listLayoutAction()
    {
        $this->view->setLayoutDisabled();
        if (!$this->object || !$this->objectId || !$this->hash || !$this->t) {
            return '';
        }
        if ($this->hash != md5(\Mmi\Session\Session::getId() . '+' . $this->t . '+' . $this->objectId)) {
            return '';
        }
        $files = [];
        $thumb = new \Cms\Mvc\ViewHelper\Thumb();
        foreach (\Cms\Orm\CmsFileQuery::byObjectAndClass($this->object, $this->objectId, $this->class)->find() as $file) {
            switch ($file->class) {
                case 'image':
                    $full = $thumb->thumb($file, 'default');
                    $small = $file->getUrl('scaley', '60', false);
                    $poster = null;
                    break;
                case 'audio':
                case 'video':
                    $full = $file->getUrl();
                    $small = '';
                    $poster = $file->data->posterFileName ? (new FileSystemModel($file->data->posterFileName))->getPublicPath() : null;
                    break;
            }

            $files[] = [
                'id' => $file->id,
                'title' => $file->original,
                'full' => $full,
                'thumb' => $small,
                'poster' => $poster,
                'class' => $file->class,
                'mime' => $file->mimeType,
            ];
        }

        //przekazanie danych
        $this->view->files = $files;
    }
266759
public function get_images() {
        $results = $this->api_call('images.php', array(
            'collection' => $this->get_type()
        ));

        return array_map(function($o) {
            return $this->get_image($o);
        }, $results);
    }
406043
public function getList($path = '/') {/*{{{*/

        $rsp = $this->_do_request('GET', $path);

        $list = array();
        if ($rsp) {
            $rsp = explode("\n", $rsp);
            foreach($rsp as $item) {
                @list($name, $type, $size, $time) = explode("\t", trim($item));
                if (!empty($time)) {
                    $type = $type == 'N' ? 'file' : 'folder';
                }

                $item = array(
                    'name' => $name,
                    'type' => $type,
                    'size' => intval($size),
                    'time' => intval($time),
                );
                array_push($list, $item);
            }
        }

        return $list;
    }
393327
public function imageList($all = false)
    {
        return $this->browser->get(
            $this->uri->expand(
                '/images/json{?all}',
                array(
                    'all' => $this->boolArg($all)
                )
            )
        )->then(array($this->parser, 'expectJson'));
    }
1370696
public function getNameList()
	{
		$options['only'][] = '*.php';
		$fileList = FileHelper::findFiles($this->getFixtureDataDir(), $options);
		$fileList = array_map(function($file) {
			return pathinfo($file, PATHINFO_FILENAME);
		}, $fileList);
		return $fileList;
	}
682939
protected function _getPaths()
    {
        $directories = $this->_createDirectoryIterator($this->_getRootDir());
        $flattened   = $this->_createRecursiveIteratorIterator($directories);
        $flattened->setMaxDepth($this->_getMaxDepth());
        $filter = $this->_createFilterIterator($flattened, function (SplFileInfo $current, $key, Iterator $iterator) {
            return $this->_filterFile($current);
        });

        return $filter;
    }
905362
private function getThumbnailBaseFolderPaths()
    {
        if (is_array($this->thumbnailBaseDir)) {
            return $this->thumbnailBaseDir;
        }

        $this->thumbnailBaseDir = [];

        if (null !== $baseFolder = $this->getBaseFolder()) {
            $thumbnailBaseDir = array_map(function ($directory) use ($baseFolder) {
                return str_replace(
                    DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR,
                    DIRECTORY_SEPARATOR,
                    $directory.DIRECTORY_SEPARATOR.$baseFolder
                );
            }, $this->application->getResourceDir());

            foreach (array_unique($thumbnailBaseDir) as $directory) {
                if (is_dir($directory)) {
                    $this->thumbnailBaseDir[] = $directory;
                }
            }
        }

        return $this->thumbnailBaseDir;
    }
885040
public function getSortedImages()
    {
        $imagesSort = explode(',', $this->getImagesSort());
        $orderCollection = array_reverse($imagesSort);
        $imagesCollection = $this
            ->getImages()
            ->toArray();

        usort(
            $imagesCollection,
            function (
                \Elcodi\Component\Media\Entity\Interfaces\ImageInterface $a,
                \Elcodi\Component\Media\Entity\Interfaces\ImageInterface $b
            ) use ($orderCollection) {

                $aPos = array_search($a->getId(), $orderCollection);
                $bPos = array_search($b->getId(), $orderCollection);

                return ($aPos < $bPos)
                    ? 1
                    : -1;
            }
        );

        return new ArrayCollection($imagesCollection);
    }
434327
protected function getImageSizeList()
	{
		$arrSizes = \System::getContainer()->get('contao.image.image_sizes')->getAllOptions();

		if (is_array($arrList = \StringUtil::deserialize($this->sizeList)))
		{
			$arrSizes['image_sizes'] = array_intersect_key($arrSizes['image_sizes'], array_flip($arrList));
		}
		else
		{
			$arrSizes['image_sizes'] = array();
		}

		if ($this->canEnterSize)
		{
			return $arrSizes;
		}
		
		return $arrSizes['image_sizes'];
	}
33191
def list_images(self):
        

        try:
            return list_images(self._NODE_TYPE)
        except OSError as e:
            raise aiohttp.web.HTTPConflict(text="Can not list images {}".format(e))
100328
public function lists()
    {
        $parts = explode('.', $this->file->filename);

        $extension = array_pop($parts);

        $name = $this->file->path(implode('.', $parts));

        $files = glob($this->file->realPath("{$name}-*"));

        array_walk($files, function (&$file) {
            $file = substr($file, strrpos($file, '/') + 1, strlen($file));
            $file = $this->file->path($file);
        });

        return collect($files);
    }
127095
public function getImagesForSeo() {
		$result = new ArrayList();
		$pwis = $this->owner->AllChildren()->where("ClassName in (
			'PageWithImage','PageWithImagesFolder')");
		foreach ($pwis->getIterator() as $pwi) {
			if ($pwi->MainImageID > 0) {
				$result->push($pwi->MainImage());
			}
		}
		return $result;
	}
145732
public function getFileList()
    {
        $allfiles = [];

        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($this->project);

            $files = $ds->getIncludedFiles();

            // We need to store these files keyed by the basedir from DirectoryScanner
            // so that we can resolve the fullpath of the file later.
            if (isset($allfiles[$ds->getBasedir()])) {
                $allfiles[$ds->getBasedir()] = array_merge($allfiles[$ds->getBasedir()], $files);
            } else {
                $allfiles[$ds->getBasedir()] = $files;
            }
        }

        $struc = [];

        foreach ($allfiles as $basedir => $files) {
            foreach ($files as $file) {
                // paths are relative to $basedir above
                $path = strtr(dirname($file), DIRECTORY_SEPARATOR, '/');

                if (!$path || $path == '.') {
                    $path = '/'; // for array index
                }

                $parts = explode('.', basename($file));
                $ext = array_pop($parts);
                if (strlen($ext) == strlen($file)) {
                    $ext = '';
                }

                $f = new PhingFile($basedir, $file);

                $struc[$path][] = [
                    'file' => basename($file),
                    'ext' => $ext,
                    'path' => (($path == '/') ? basename($file) : $path . '/' . basename($file)),
                    'fullpath' => $f->getAbsolutePath()
                ];
            }
        }

        uksort($struc, 'strnatcasecmp');
        foreach ($struc as $key => $ind) {
            usort($ind, [$this, 'sortfiles']);
            $struc[$key] = $ind;
        }

        $tempstruc = $struc;
        $struc = ['/' => $tempstruc['/']];
        $bv = 0;
        foreach ($tempstruc as $key => $ind) {
            $save = $key;
            if ($key != '/') {
                $struc['/'] = $this->setupDirs($struc['/'], explode('/', $key), $tempstruc[$key]);
            }
        }
        uksort($struc['/'], [$this, 'mystrucsort']);

        return $struc;
    }