Skip to content

Commit

Permalink
add data response
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytubbs committed Feb 14, 2016
1 parent e4211c6 commit 1864878
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/Deepzoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function makeTiles($image, $file = NULL, $folder = NULL)
$filename = $this->cleanupFilename($filename);

// set folder or use path filename
$foldername = $folder !== NULL ? $folder : pathinfo($image)['filename'];
$foldername = $folder !== NULL ? $folder : pathinfo($image)['dirname'];
$foldername = $this->cleanupFolderName($foldername);

// check for spaces in names
Expand All @@ -84,16 +84,22 @@ public function makeTiles($image, $file = NULL, $folder = NULL)
$JSONP = $this->createJSONP($filename, $height, $width);
$this->path->put($foldername.'/'.$filename.'.js', $JSONP);

$data = [
'output' => [
'JSONP' => "$foldername/$filename.js",
'DZI' => "$foldername/$filename.dzi"
],
'event' => 'deepzoom',
'source' => $image,

];

// used with Laravel to fire event
if ( defined('LARAVEL_START') ) \Event::fire('deepzoom', [$results]);
if ( defined('LARAVEL_START') ) \Event::fire('deepzoom', [$data]);

return [
'status' => 'ok',
'data' => [
'JSONP' => "$foldername/$filename.js",
'DZI' => "$foldername/$filename.dzi",
'_files' => "$foldername/$filename"."_files"
],
'data' => $results,
'message' => 'Everything is okay!'
];
}
Expand Down

0 comments on commit 1864878

Please sign in to comment.