-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some logging. Warn if using vendored perl. Up version for release. Allow Nextcloud 17.
- Loading branch information
1 parent
6b1c033
commit 1bf0a55
Showing
7 changed files
with
159 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,4 @@ | ||
<?php | ||
|
||
use OCP\AppFramework\App; | ||
$app = new App('camerarawpreviews'); | ||
$container = $app->getContainer(); | ||
$eventDispatcher = \OC::$server->getEventDispatcher(); | ||
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function() { | ||
script('camerarawpreviews', 'register-viewer'); // adds js/script.js | ||
}); | ||
$mimeTypeDetector = \OC::$server->getMimeTypeDetector(); | ||
$mimes = $mimeTypeDetector->getAllMappings(); | ||
$mimes_to_detect = [ | ||
'indd' => ['image/x-indesign'], | ||
'3fr' => ['image/x-dcraw'], | ||
'arw' => ['image/x-dcraw'], | ||
'cr2' => ['image/x-dcraw'], | ||
'cr3' => ['image/x-dcraw'], | ||
'crw' => ['image/x-dcraw'], | ||
'dng' => ['image/x-dcraw'], | ||
'erf' => ['image/x-dcraw'], | ||
'fff' => ['image/x-dcraw'], | ||
'iiq' => ['image/x-dcraw'], | ||
'kdc' => ['image/x-dcraw'], | ||
'mrw' => ['image/x-dcraw'], | ||
'nef' => ['image/x-dcraw'], | ||
'nrw' => ['image/x-dcraw'], | ||
'orf' => ['image/x-dcraw'], | ||
'ori' => ['image/x-dcraw'], | ||
'pef' => ['image/x-dcraw'], | ||
'raf' => ['image/x-dcraw'], | ||
'rw2' => ['image/x-dcraw'], | ||
'rwl' => ['image/x-dcraw'], | ||
'sr2' => ['image/x-dcraw'], | ||
'srf' => ['image/x-dcraw'], | ||
'srw' => ['image/x-dcraw'], | ||
'tif' => ['image/x-dcraw'], | ||
'x3f' => ['image/x-dcraw'], | ||
]; | ||
|
||
$mimeTypeDetector->registerTypeArray($mimes_to_detect); | ||
|
||
$previewManager = $container->getServer()->query('PreviewManager'); | ||
|
||
$previewManager->registerProvider('/^((image\/x-dcraw)|(image\/x-indesign))(;+.*)*$/', function () { | ||
return new \OCA\CameraRawPreviews\RawPreview; | ||
}); | ||
$app = new \OCA\CameraRawPreviews\AppInfo\Application; | ||
$app->register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,17 @@ | |
<name>Camera RAW Previews</name> | ||
<summary>Preview and show camera RAW files in Nextcloud/ownCloud</summary> | ||
<description><![CDATA[This app will make previews of "RAW" files from cameras in Nextcloud/ownCloud.]]></description> | ||
<version>0.7.0</version> | ||
<version>0.7.1</version> | ||
<licence>agpl</licence> | ||
<author mail="[email protected]" >Ari Selseng</author> | ||
<namespace>CameraRawPreviews</namespace> | ||
<screenshot>https://raw.githubusercontent.com/cowai/camerarawpreviews/master/screenshots/screenshot1.png</screenshot> | ||
<screenshot>https://raw.githubusercontent.com/ariselseng/camerarawpreviews/master/screenshots/screenshot1.png</screenshot> | ||
<category>files</category> | ||
<category>multimedia</category> | ||
<bugs>https://github.com/cowai/camerarawpreviews/issues</bugs> | ||
<bugs>https://github.com/ariselseng/camerarawpreviews/issues</bugs> | ||
<dependencies> | ||
<owncloud min-version="10" max-version="10" /> | ||
<nextcloud min-version="11" max-version="16" /> | ||
<nextcloud min-version="11" max-version="17" /> | ||
</dependencies> | ||
<types><filesystem/></types> | ||
</info> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace OCA\CameraRawPreviews\AppInfo; | ||
|
||
use OCA\CameraRawPreviews\RawPreview; | ||
use OCP\AppFramework\App; | ||
|
||
class Application extends App | ||
{ | ||
private $appName; | ||
|
||
public function __construct() | ||
{ | ||
$this->appName = 'camerarawpreviews'; | ||
|
||
parent::__construct($this->appName); | ||
} | ||
|
||
public function register() | ||
{ | ||
$this->registerScripts(); | ||
$container = $this->getContainer(); | ||
$mimeTypeDetector = \OC::$server->getMimeTypeDetector(); | ||
$mimes_to_detect = [ | ||
'indd' => ['image/x-indesign'], | ||
'3fr' => ['image/x-dcraw'], | ||
'arw' => ['image/x-dcraw'], | ||
'cr2' => ['image/x-dcraw'], | ||
'cr3' => ['image/x-dcraw'], | ||
'crw' => ['image/x-dcraw'], | ||
'dng' => ['image/x-dcraw'], | ||
'erf' => ['image/x-dcraw'], | ||
'fff' => ['image/x-dcraw'], | ||
'iiq' => ['image/x-dcraw'], | ||
'kdc' => ['image/x-dcraw'], | ||
'mrw' => ['image/x-dcraw'], | ||
'nef' => ['image/x-dcraw'], | ||
'nrw' => ['image/x-dcraw'], | ||
'orf' => ['image/x-dcraw'], | ||
'ori' => ['image/x-dcraw'], | ||
'pef' => ['image/x-dcraw'], | ||
'raf' => ['image/x-dcraw'], | ||
'rw2' => ['image/x-dcraw'], | ||
'rwl' => ['image/x-dcraw'], | ||
'sr2' => ['image/x-dcraw'], | ||
'srf' => ['image/x-dcraw'], | ||
'srw' => ['image/x-dcraw'], | ||
'tif' => ['image/x-dcraw'], | ||
'x3f' => ['image/x-dcraw'], | ||
]; | ||
|
||
$mimeTypeDetector->registerTypeArray($mimes_to_detect); | ||
|
||
$previewManager = $container->getServer()->query('PreviewManager'); | ||
$appName = $this->appName; | ||
$previewManager->registerProvider('/^((image\/x-dcraw)|(image\/x-indesign))(;+.*)*$/', function () use($appName) { | ||
return new RawPreview($this->getContainer()->getServer()->getLogger(), $appName); | ||
}); | ||
|
||
} | ||
|
||
private function registerScripts() | ||
{ | ||
$eventDispatcher = \OC::$server->getEventDispatcher(); | ||
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function () { | ||
script($this->appName, 'register-viewer'); // adds js/script.js | ||
}); | ||
} | ||
|
||
} |
Oops, something went wrong.