Is that possible to embed a Blob URL image in markdown? - image

I want to embed a Blob URL image in my Github README.md file. When I tried ![image](blob:https://{...}) it failed. Is that possible to embed this format in markdown file?

Unfortunately github doesnt allow either blob or data uri's as image source.
source : https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images

Related

Do you have to know the image file type before uploading to Firebase Storage?

When adding an image file from a device that is retrieved by the user to firebase cloud storage, would it be okay to append .jpg, .png, or .webp to the filename?
For example,
storageReference.child('images/example.jpg').putFile(file)
or
storageReference.child('images/example.png').putFile(file)
I've been doing this in the past with no problems, but it doesn't feel right.
Would I have to retrieve the file type and add the appropriate extension?
I would want all the images in the firebase storage to have the same file extension, but I am not sure if getting different file types from ImagePicker and adding a uniform extension is a proper way to save an image?
Creating a flutter app...
You don't need to specify a type. If you specify a specific file ending like .png or .jpg, firebase storage will override the auto-detected type. Take a look at the firebase storage docs here. It goes into more depth, but bottom-line answer is if you specify a file type firebase storage will update the initial auto-detected type.

How to edit metadata of an uploaded file to mediawiki?

I am using a extension with mediawiki that uses the metadata of the uploaded file to generate its title.
However I cannot see how to edit the metadata for an uploaded file in mediawiki at all.
Here is the documention for the extention:
CategoryGallery with captions generated from image description files
(requires CategoryGallery extension) You'll need
Extension:CategoryGallery for this. Place image descriptions on your
image file pages (e.g. File:Popsicle stick Eiffel Tower.jpg) using the
same PageSummary template as before. Now, on the page where you're
putting the gallery, use e.g.:
<catgallery cat="Aubry" bpdcaption="short_summary" />
The result is as
follows (note how the captions are generated using the metadata you
saved on each image page):
How can I do this? Here is an example of the files I have uplaoded: http://www.gwart.co.uk/File:Eldar_Avatar_-_Mark_Gibbons_1994.jpg
If you are talking about metadata generated by CommonsMetadata, see here. There is also metadata extracted from the file; you can't edit that, short of editing the file itself.

MigraDoc - How to Add image from External URL

I am not able to add image that is saved at a URL something like "http://host/img.png" using below code snippet:
section.AddImage(url);
However if I use url as a relative url of image that is present on my disk then this is working fine.
Is this limitation of MigraDoc?
Can someone provide workaround, code samples to over come this?
MigraDoc works with local files (relative or absolute paths), not with files that are somewhere on the Internet.
AddImage() needs a path, not a URL.
You can download the image from the URL and either store it in a local file or store it in a string using BASE64 encoding and pass that string to MigraDoc.
You will have control over accessing the image from the web and can properly deal with problems.
See this article on BASE64 encoding for MigraDoc images:
http://pdfsharp.net/wiki/MigraDoc_FilelessImages.ashx

Reading a post request with image file, and convert in base64 encoding string

I wanted to ask how can we read a post request of a form that has file upload and then convert the file in base64 encoded form.
Looked at the examples shown in the play framework site, but it only explains about uploading a file and storing it in some location. But what if I need to convert the uploaded image into a base64 encoded form??
I looked through various resources, could not find what I was looking for. I just have a simple form that uploads image and need convert the upload image to base64 encoding. And yes I am using play framework.
Any help, please.
Update:
What I was actually searching for was:
val imageRaw:Option[play.api.mvc.MultipartFormData.FilePart[play.api.libs.Files.TemporaryFile]] = request.body.file("picture").map { picture =>
picture
}
Now how do I convert the imageRaw to base64 encoded string, I don't need to store the image in the disk.
Update2:
What I really had to achieve was load an image using drag and drop functionality and then load the image in a HTML5 canvas, had no problems with other browsers but since IE9 doesn't support FileReader Api, I couldn't retrieve its imageData after its loaded using the DnD functionality.
So, now I am trying to use polyfills to be able to use FileReader API in IE9, does anyone have any idea or samples of how to use them. I have been trying to use FileReader API for now, but can't get to know how to use it.

why does web server display images corrupterd?

I have a page in JSP, which has a tag like:
<img src="images/1.bmp"></img>
The 1.bmp is like:
But the image which looks in my page, visited by firefox, is like:
what should i do to fix this problem?
I've converted the images which you uploaded into your question back to BMP and investigated their source. Everywhere where a non-ISO-8859-1 character appears in the original source, a ? appears in the malformed source.
This means that you've a servlet on /images/* which uses response.getWriter() to write the image using the platform default charset. You shouldn't do that. BMP files are not text files. BMP files are binary files. You should be using response.getOutputStream() to write binary data. You can find a basic and proper example of an image servlet in this article.

Resources