[owncloud-devel] File Preview for New File Type
developer at georgehrke.com
Tue Jul 29 19:40:32 GMT 2014
On Jul29 2014, at 09:19 PM, Aaron Boxer <boxerab at gmail.com> wrote:
> Can someone please explain or point me to any docs on how
> to add file preview to new file type? I would like to preview .dcm
> files, which are DICOM medical images.
You need to write a class that implements certain methods:
- getMimeType() - this function should return 'application/dicom’ in your case.
- getThumbnail() - this function would return the actual preview.
You mentioned imagemagick in an earlier mail.
An example of a preview provider that uses imagick is the pdf provider:
(You can ignore the " . '’” in the imagick constructor.)
Finally you need to register your preview providers.
You would put this line of code into your appinfo/app.php
You shouldn’t use \OC\Preview directly, but sadly there is no public api function for this yet.
I’ll add one and I’ll also write a proper interface for preview providers.
> Also, another question: is it possible to filter uploaded files to detect
> the actual file format? If a user uploads a file FOO.BAR which is actually
> a dicom file, is there a way of filtering and storing meta-data about the file?
ping @icewind :)
> Thanks very much!
> Devel mailing list
> Devel at owncloud.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel