Recognised file types for image preview? - svg

Is it possible to add additional file types to be recognised as images and thus trigger automatic creation of an image view when a resource is uploaded?
SVG files will preview in CKAN, but we have to manually add the image view e.g.
https://datastore.landcareresearch.co.nz/dataset/novel-yeasts-from-new-zealand-forests/resource/3812ee6b-dd45-45c9-b425-6a18375e5727
With text (for example) we can specify file format extensions to recognise as text and automatically create a text preview (ckan.preview.text_formats...). Is there an equivalent for images?
Thanks

It would only be possible by modifying the source code for your instance:
https://github.com/ckan/ckan/blob/master/ckanext/imageview/plugin.py#L9
Seems like a great idea to have the image view on a par with the text view in this regard, so I made a pull request:
https://github.com/ckan/ckan/pull/3380

Related

Diagrams Net (Draw IO) Link to open local file

I have a project documentation written in ASCIIDOC with editable PNGs and
I would like to create a link in my documentation that opens a local file directly in draw.io (diagrams.net).
Something like https://app.diagrams.net/file=/home/alex/test.png.
or https://app.diagrams.net/data={HEX DATA OF PNG}
My first stop was in the documentation: https://www.diagrams.net/doc/faq/supported-url-parameters
but I couldn't figure out how to transform my editable PNGs for the data parameter nor how to instruct the application to automatically open the upload dialog.
Any advice is greatly appreciated.

Nuxtjs including images from assets using the content module

I am trying to use the nuxt.js Nuxt.js content module. Is there a way to display images we refer to in our blogpost.md file? I know that we can put images in the front matter, but I want the create of the articles to put images inside their created .md file. Lets say we have a file:
-- start of .md file --
# some text
some description
![Image of test](../../assets/images/test.jpg)
![Image of Yaktocat](https://octodex.github.com/images/yaktocat.png)# some text
some description
-- end of .md file --
I end up seeing the image that is linked using https. But the other image is not displayed?? When checking the page I see an <img> tag is created, but no image to be seen...
When I check the structure using any other markdown editor, I see the image.
Including links to images does display images. But I need to include locally stored images.
any help greatly appreciated
Partially solving the issue, some images can be added using metadata (like cover images), those cannot be added within the content itself, just above or bellow actual content.
---
title: Sample
image: test.jpg
---
Here the markdown (without images)
In the view you can render that image after or before the content using something like:
<img :src="require(`~/assets/images/${ page.image }`)">
<nuxt-content :document="page"/>

Images not resizing in WYGWAM/Safecracker/Channel Images entry form

I have a blog that uses Channel Images to upload and manage images. The content area is a WYGWAM field. I have a few sizes set up in Channel Images to allow the user to adjust the layout inside their content (landscape left, landscape right, portrait left, portrait right) when adding images to the WYGWAM content field. I then have two other sizes: thumb and gallery. These are for the image gallery that appears below the content. Thumb is set as the small preview in the field settings, and gallery is set as the big preview in the field settings. It all works great in the CP publish form.
However, when using the Safecracker form things don't work as well. I can select existing images, but when I add a photo to the content field (WYGWAM) it does not resize it properly. I do get the dialog box and options I want to choose from, but that choice is not being saved.
What happens is the image is added to the WYGWAM content using the size I have selected in the field settings as the big preview. I tested this by changing what size is selected for "big preview".
However, if I upload a new image and select a size it works fine. The issue is only with existing images (ie uploaded previously for other entries).
Is it possible to use sizes in Channel Images/safecracker/wygwam?
It was a bug in the most recent build. The developer has sent me a patched version that is working.

Xpages fileupload control and mime types

I have a problem uploading an image to a form field using the built in xpages fileuploader control. The form field the image is saved to is configured like explained in this blog post by Mats Knutsen: http://devxpages.blogspot.com/2011/03/display-picture-from-rich-text-field.html . I Also plan to display the image in an xpage using the template described in the blog post, like this (http://server/MyDatabase.nsf/viewunid/docunid/imageField/M2?OpenElement).
I know my fileuploader control points to the correct field in the form, since i can see the image in the document using the Lotus Notes Client after the document is created. However; the picture can not be viewed using "http://server/MyDatabase.nsf/viewunid/docunid/imageField/M2?OpenElement" at this point.
On the other hand, if I delete the field contents (the image) from the document field in the client, go back to the xpage with the fileuploader control, and uploads the image a second time, it works perfectly, and the image can be viewed using the url mentioned above.
When I access field properties after the first upload, the Data Type of my field is set to Rich Text.
The second time I upload the same image to the same field in the same document, the field properties Data Type is set to MIME Part, as it probably should have gotten the first time around as well.
Does anyone know why my file uploader control does not work the first time i upload the image, but when I edit the docuement and upload the image a second time, everything seems to be ok?
I would try to avoid uploading images into the RichText in the first place. Would it break your application if you resort to uploading the image as a regular attachment? You then can reference it using .../$File/imgfilename.jpg (using the file name used during upload - retrieved by #AttachmentNames)

How to modify Sharepoint filetype icons depending on parts of the filename?

We have a SharePoint Document library, where we store html files with links to external files. Samples:
mypicture.jpg.html
mywordfile.docx.html
mypdffile.pdf.html
and so on. Now by default all Files show up with the HTML Icon, referenced in the DOCICON.XML file. Thats of course correct as the .html extension shows, it is a HTML file. But we want the files to have different icons, based on their original file type.
Is there a way to automatically change the Icon
during rendering or
when we save the file to the library (via SharePoint API)?
Any other approachs?
Why not use a little jquery to change the icon during rendering? Each doc in your library should be contained in
<td class="ms-vb-icon"><a tabindex=...><img ... src="/_layouts/images/ichtm.gif"></a></td>
I think you can slurp that into an array, assign a new var that's just the href stripped of path/filename. and .html, and use that to replace htm in the src tag.
Could you not just edit the DOCICON.xml to add the ".jpg.html" and ".docx.html" extensions in?
For a full listing of icon files see all "ic*.gif" files in the TEMPLATE\IMAGES directory under the 12 hive. Unfortunately, this will not solve your problem, but this is where you can change it based on the extension, if you so choose.
Note that a blog I wrote a while back has a different focus, but does discuss where the icons come from: http://wiki.threewill.com/display/is/2007/10/14/External+Link+for+Editing+a+SharePoint+Document.

Resources