On Sunday 04 January 2015 05:17:18 jukah wrote:
> Hey all,
>
> i just wanted to continue on the DICOM-Feature for Owncloud (v 7.0.4.2 on
> debian) but got stuck.
>
> First thing i would like to get working is thumbnail-preview (dicom viewer
> would be nice, but i am not a professional developer, so starting with a
> small job seems better) using your hints from this conversation to get
> started.
>
> Converting dicom to image with Imagick works fine using this code for
> example:
>
> <?php
> $data = new imagick( 'test.dcm' );
> $data->setImageFormat('jpeg');
> $im = imagecreatefromstring($data);
> header('Content-Type: image/jpeg');
> imagejpeg($im);
> ?>
>
> As the PDF thumbnail Preview uses imagick too - i tried this way:
> * duplicate of lib/private/preview/pdf.php named dicom.php with this code:
>
> class DICOM extends Provider {
>
> public function getMimeType() {
> return '/application\/dicom/';
> }
>
> public function getThumbnail($path, $maxX, $maxY,
> $scalingup,
$fileview)
> {
> $tmpPath = $fileview->toTmpFile($path);
>
> //create imagick object from pdf
> try{
> $dicom = new Imagick($tmpPath);
> $dicom->setImageFormat('jpg');
i think it should be 'jpeg' as you have it in the snippet above.
> } catch (\Exception $e) {
> \OC_Log::write('core',
> $e->getmessage(), \OC_Log::ERROR);
> return false;
> }
>
> unlink($tmpPath);
>
> //new image object
> $image = new \OC_Image($dicom);
>
>
> * add the mimetype application\dicom to lib/private/mimetypes.list.php
> * include the dicom.php in lib/private/preview/preview.php
> * enabled preview providers 'OC\Preview\DICOM' in /config/config.php
>
> owncloud.log is not very helpful, and i dont know where my problem is
> located. the output of imagick should be the same as with PDF i think ?!
What actually happens, any output or error message?
Cheers
Arthur
>
> Thanks for your help in advance!
> Julius
>
>
>
> --
> View this message in context:
> http://owncloud.10557.n7.nabble.com/Viewing-medical-DICOM-images-with-ownCl
> oud-tp12927p13767.html Sent from the Developers mailing list archive at
> Nabble.com.
> _______________________________________________
> Devel mailing list
> [email protected]
> http://mailman.owncloud.org/mailman/listinfo/devel
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
XMPP: [email protected]
www.owncloud.com - Your Data, Your Cloud, Your Way!
ownCloud GmbH, GF: Markus Rex, Holger Dyroff, Frank Karlitschek
Schloßäckerstrasse 26a, 90443 Nürnberg, HRB 28050 (AG Nürnberg)
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Devel mailing list [email protected] http://mailman.owncloud.org/mailman/listinfo/devel
