-
Notifications
You must be signed in to change notification settings - Fork 336
raw support #1113
Comments
please submit a pull request - thanks a lot for your contribution! |
Suggestion: check if exiftool is present/accessible and decide if raw conversion is possible. A big feature would be, that conversion time would change something in the browser showing the user conversion is in progress. You can easily add additional raw formats to the array, please see the list added: From: http://en.wikipedia.org/wiki/Raw_image_format Adobe Digital Negative DNG *.dng One question, hopefully not stupid, but does this also work when the source folder containing the picture is read only?. I ask because of the statement: $this->image->save($this->path) |
Implementation via ImageMagick |
Can this be closed then? |
I has modify the gallery's code (thumbnail.php and image.php) to allow the browser display raw files.
The environment of os need to install exiftool.
For ubuntu, you should be use "sudo apt-get install exiftool" to install exiftool.
Applying the modify code, the browser would be display raw file correctly,
However, for ios app, the ownCloud app could not display raw file correct.
It is need to modify of app by owncloud's authorities.
//---------------------------------------------------------------------------------
in gallery/lib/thumbnail.php: line 52
//---------------------------------------------------------------------------------
if(in_array(strtolower($extension),array("nef","orf")))
{
$this->path = $galleryDir . $image . '.jpg';
$jpgfile = $galleryDir . $image . '_o.jpg';
$img=$this->view->getLocalFile($imagePath);
if (!file_exists($this->path))
{
//raw file to jpg
$cmd="exiftool -b -JpgFromRaw "{$img}" > "{$jpgfile}""; //need exiftool
system("$cmd");
//jpg to thumbnail
$this->image = new \OC_Image($jpgfile);
if ($this->image->valid()) {
$this->image->fixOrientation();
if ($square) {
$this->image->centerCrop(200);
} else {
$this->image->fitIn(400, 200);
}
$this->image->save($this->path);
}
}
}
else
$this->path = $galleryDir . $image . '.' . $extension; //original line number 52
//---------------------------------------------------------------------------------
in gallery/ajax/image.php: line 30
//---------------------------------------------------------------------------------
$extension=strtolower(pathinfo($img,PATHINFO_EXTENSION));
if(in_array($extension,array("nef","orf")))
{
$main_filename=pathinfo($img,PATHINFO_FILENAME);
$galleryDir = \OC_User::getHome($owner) . '/gallery/' . $owner . '/';
$img_path=dirname($img);
$jpg="{$galleryDir}/{$img_path}/{$main_filename}_o.jpg";
if(file_exists($jpg))
{
header('Content-Type: image/jpeg');
readfile($jpg);
exit;
}
}
//---------------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered: