cannot load images into dompdf on same server? - image

Why cant i add images on my server to a pdf? I think it has something to do with the url structure, is it supposed to be different for this scenario?
currently its:
<img src="http://mywebsite.com/images/image.jpg">

Related

Gatsby images - scaling and lazy loading images in markdown html

I have a lot of markdown files that I've imported into Contentful with images linked inside of them. The images link to external websites like Imgur for the source.
I'm trying to get the images to scale up and lazy load like you can do using the Gatsby Image API. The problem is that the images are all within the one html node due to how the markdown is processed.
The markdown is being set on the page using:
dangerouslySetInnerHTML={{ __html: body.childMarkdownRemark.html }}
Is what I'm trying to do possible? I feel like there is some way to chain Gatsby plugins to download the images locally from the html and then create nodes in GraphQL to handle this but I'm not sure. Ideally I don't want to have to change the markdown files to point to Contentful assets due to it not being easy to migrate to other solutions in the future.
Any help would be appreciated! Thanks

Replace a remote image with a local image on static web pages

I have an image that displays stock quotes update on our website. This is being fed by an external site with a static path pointing to this remote image. (This image gets updated with stock info there). The updates don't happen now and I will have to remove this image on several static web pages on my site until something else is in place.
Is there a way I can over-write this image easily on all pages with a local image within the site? I was wondering if there is a way I can get this done on the site level, may be tweak the apache conf file. Any other work around suggestions. Please let me know. Thanks!!
Add crossorigin attribute to get images from 3rd party websites
example:
<img height="100" width="100" crossorigin=anonymous src="https://media.licdn.com/mpr/mpr/shrinknp_200_200/AAEAAQAAAAAAAAjTAAAAJDNlOGJiNTRkLTJhMzMtNDZlMi05NjJiLTZmMGRhODkzMzVkNw.jpg" />

SpringMVC: What is the best strategy to display an Image?

May I know what is the best strategy to display an image (blob) from database.
using Spring MVC.
Should I load all the image at once from db or create a controller method to get the images individually?
Some tutorial link will be greatly appreciated.
Save the file on the server rather than the DB, serve up the link address to the file through the controller.
The images should be in a cdn location or similar and the Spring controller just returns a url to them.
EDIT :
If you really must serve up the image from the DB and serve it as bytes, you can find the answer you want here

How to populate image thumbnails (image grid) on my web page using JSP

I wants to populate image thumbnails (image grid) on my web page using JSP. Please suggest the best way. Also please suggest what should I store in the DB, image in binary format or path of the image in text format ?
The correct answer would be It depends on your project requirements
I would like to write my experience, if the images had to be prevented from un-authorized access then database would be a good option, but ASAIK I haven't developed any such application in past 3 years. I would just prefer putting up the images in a folder and then have their name in DB for reference purposes.
I just thing database has more important information to store & retrieve and I don't want to choke the database connections retrieving images.

Using MVCMailer to embed image in email

How do you use MVCMailer to embed an image into a email?
I've tried something along the lines of
<img src="#Url.Abs("\\..\\images\logo.png")" \>
with no success.
Any examples?
Thanks
Look at the MvcMailer wiki
https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide
search for Embed Image and you'll and you are done!
Try like this:
<img src="#Url.Abs(Url.Content("~/images/logo.png")" />
Also make sure that the absolute url that is generated by this helper is accessible when you open the email in your mail client. For example if you hosted your ASP.NET MVC application in the local visual studio web server ensure that it is running when you try to read the email as the image must be accessible.
You have to type the entire URL where your image is, and also it has to be hosted online.
So for example , i want to embed the image that is called Logo.png and it's located in the folder Images in my project , i'll write in the view of my MvcMailer:
<img src="http://mywebsite.com/Images/Logo.png" />

Resources