public function testCollectionFileListColumn() { $testdata = <<<EOF Number,Type,Description,Notes,Files 1,Drawing,A drawing of a fish, fishy fishy fishy, /nonexistent/path.jpg;/another/badpath.jpg EOF; $collection = new Collection(); $collection->parseFromCSVData($testdata); $entries = $collection->getEntries(); $this->assertEquals(2, count($entries[0]["Files"])); $this->assertInstanceOf("Image", $entries[0]["Files"][0]); }
<?php require dirname(__FILE__) . "/autoload.php"; $id = $_GET['entry']; $image = $_GET['image']; $width = $_GET['width']; $collection = new Collection(); $collection->parseFromCSVData(file_get_contents(dirname(__FILE__) . "/" . $collection_file_path)); header('Content-Type: image/jpeg'); print $collection->getEntries()[$id]["Files"][$image]->getImage($width);