Page: How to add images to a Biostars post
33
gravatar for RamRS
19 months ago by
RamRS24k
Houston, TX
RamRS24k wrote:

Summary

  • You can add an uploaded image to your biostars post. The image should be accessible to the public via a straightforward URL. Do not use Google Drive/DropBox/any website that requires log-in
  • Method 1: Upload the image, get the image direct URL (should end with an image file extension such as .jpeg or .png, and when you open the link in a browser, it should show only the image) and use with the image option on the biostars toolbar
  • Method 2: Upload the image, get the embed HTML code and use it as part of the post text.

UPDATE

I have removed the cubeupload method, as imgbb universally works for everyone.


(Ridiculously) Detailed description follows

Here are two ways you can add an image to your post - using Markdown syntax, and with inline HTML. Markdown syntax looks better, while Inline HTML gives you more control and is easier. I'll demonstrate both methods here, and you can pick the one most appropriate to you.


  1. Upload your image
  2. Add the image to your biostars post using one of the following methods:
    1. Markdown Method
    2. Inline HTML Method
how-to page • 2.4k views
ADD COMMENTlink modified 4 weeks ago • written 19 months ago by RamRS24k
1

A suggestion: Adding a function in the web that can identify whether an url link inserting has a figure basename (like png) during inserting a figure will effectively solve the issue. In most cases failed, people uploaded an HTML link, which needs to be opened to get the real figure link. Thank you.

ADD REPLYlink written 17 months ago by Zhilong Jia1.5k

Thank you for the suggestion. If you could check out the https://github.com/ialbert/biostar-central repository and suggest the code changes to be made to add your validation code in, that'd be great. I also think this might require forking and making changes to the underlying markdown engine.

ADD REPLYlink written 17 months ago by RamRS24k
1

I'm not familiar with python. It's a shame. However, I filed an issue at github and gave a simple solution that more tips during the poped inserting figure page. Thank you.

ADD REPLYlink written 17 months ago by Zhilong Jia1.5k
3
gravatar for RamRS
12 months ago by
RamRS24k
Houston, TX
RamRS24k wrote:

Upload your image:

  1. Pick a free image upload site. I'd recommend imgbb as it is accessible in most countries, including Iran. NOTE: Please do not use imggmi or other hosts with DDoS protection. These sites do not load images immediately; instead they make you wait a few seconds before leading the image. This translates to images not displaying here on biostars unless users take a bunch of extra steps to view them.
  2. Upload your image on the site. For demonstration purposes, I'm going to be using a random PCA plot image I found online. I've named the downloaded image file pca_image.png. Here's how to upload an image file on a couple of sites:

On imgbb:

  • Click on the Start Uploading button on the home page.

    Home Page

  • Navigate to your image file in the dialog that pops up. Select your file and click Open

    Choose File

  • You should now see this upload screen. Click the Upload button.

    Ready to Upload

  • You should now see this success message. Copy the link under Viewer Links (highlighted in pink) and open it in a new tab or window.

    Viewer Link

  • You should now be in the viewer window. Note the About and Embed Codes tabs in the lower left hand corner of the page.

    Viewer Page

  • Right click on the image and click on Copy Image Address. This is the direct link to the image. It should look something like this: https://image.ibb.co/eMZArc/pca_image.png

    Copy Image Address

  • Click on the Embed Codes tab in the lower left hand side of the page. That should open up a set of links that looks like this:

    Embed codes

  • Copy the highlighted HTML text under the Full Image (linked) section using the Copy hover option availabe when you click in the text box. This is the embed code for the image.

    HTML Embed code

ADD COMMENTlink modified 3 months ago • written 12 months ago by RamRS24k
0
gravatar for RamRS
12 months ago by
RamRS24k
Houston, TX
RamRS24k wrote:

a. Markdown method to embed image

  • This uses the direct link obtained from above.

  • Click on the image option on the toolbar

    Initial post

    Image option

  • Paste the copied URL in the dialog box. Click OK

    Empty Pop-up

    Filled Pop-up

  • Your post should have the image as shown below

    Image added

ADD COMMENTlink written 12 months ago by RamRS24k
0
gravatar for RamRS
12 months ago by
RamRS24k
Houston, TX
RamRS24k wrote:

b. Inline HTML method to embed image:

  • This uses the HTML embed code obtained from above

  • Paste the HTML embed code as part of the text in your post to add the image directly, as shown below

    Embed code added

  • Advanced topic: You can also modify the embed code and add more attributes to control size, alt-text, etc. See this resource on HTML image tag to know how you can tweak your image. For example, I've adjusted the image width to 200 pixels here

    Advanced Option

ADD COMMENTlink written 12 months ago by RamRS24k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1378 users visited in the last hour