Joomla & Fabrik display base64 image stored in a database field - joomla

I am building an application with fabrik and have a script that gets a base64 image code from an external source and then stores it in a database field. I would like to be able to display this image in fabrik lists on the frontend rather than displaying the base64 code. Has anyone done anything like this using fabirk in the past?

You can use a separate field that will take your base64 field and use it to construct an image tag when rendered in the list.
So let's say the data you want is in my_list___image. Create a separate field my_list___image_view of type calc.
In the calculation box, enter the following:
return '<img src="data:image/png;base64, {my_list___image}" alt="Alt text" />';
I'd also recommend adding a field for the image alt text. You also will have to take care of the image type. If they're all png or jpeg, that's fine otherwise you'll need to store or be able to derive that somehow.

Related

How to save the image URL at the exact position where the image was included in React-Quill (MERN stack)?

I am building an application, on the front end there is there are a few fields, including a rich text editor (react-quill) that can take in an image. I have saved the values from the first page and displayed them back to the user for confirmation. In order to do so I used local storage in the form of formData as shown below
formData = {"questionTitle": "Here is a test field",
"questDesc": "<p>Here is the Image <img src=\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU.. />” }
My problem is after confirmation, I am trying to push the formData to MongoDB but I need to save the image (in cloudinary) separately from the database. How do I send the image to Cloudinary and instead save the URL in the MongoDB at the exact position that was inserted in react-quill?
I want to know if there is a better solution to my problem. Currently, the image is in base64 in local storage, is there a way to just refer to the route of the image while in local storage, and push it to the cloudinary after confirming? All pointers, and suggestions welcome!!

Oracle Unifier image data to be displayed in BI Report, image data is showing just a number

Oracle Unifier image data to be displayed in BI Publisher Report, image data in the field is showing just a number. like 446 and there is another field which show a jpg file name only like 2121.jpg. And when I looked at many post around found that there is some data inside.
like below. You might have noticed on right side the example is blob i.e. some string data is there. In the unfier i just got a field value 446. So my question is how do I go about displaying the image.
I refered to this document but could not get anywhere
https://docs.oracle.com/cd/E91461_01/English/Install_and_Upgrade/Configuring/bi_publish/unifier_bi_publisher_config.pdf
and I also tried Another way to work on getting the image
but again i have the same problem my field is in numnber the people trying it out have field value in blob
https://community.oracle.com/thread/4095157
enter link description here
Below is what I worked on and got to this point.
Image in BI Publisher report from the data is not displaying. I have followed the instructions and created the url and saved it in the ALT text of the image in RTF it is not displaying the image. Below are the instructions that I have followed.
Page 16 --> Configuring BI Publisher Reports to Use Unifier Images from the below document
https://docs.oracle.com/cd/E91461_01/English/Install_and_Upgrade/Configuring/bi_publish/unifier_bi_publisher_config.pdf
The ALT Text in the image is --> url:{concat($uuu_p_urlF,'/',COMLOGO,'/',//security_token/SEC_TOKEN1)}
It id generating the correct url -->http://IPADD/bluedoor/rest/image/453/A30DEAC4-4C63-12C7-3071-7A19048E848F
If i use this url i can see the image in the browser but the same link in the ALT Text field of the image does not display the image.
Would like to to what I am doign wrong

Attach a filename to a base64 image in a JSON file

I have an application that gets a JSON file via a web service. The JSON is fairly large, and represents a Person object, with typical properties such as first name, last name, title and image for example. The person's image is stored as a base64 field in the JSON. It is bound to an image tag using Angular. So for example, the HTML looks like this:
<img ng-src="data:image/jpeg;base64,{{ person.fileImage }}">
When the end user right clicks on the image and chooses to save the image, the browser defaults to the name "download.jpg". What I need to do is name the image so that when the user right clicks and chooses to save, it gives a meaningful filename, e.g.:
todd.davis.jpg
I'm not sure how to make this happen. I've seen some solutions that use an anchor tag with a download="todd.jpg" parameter, but that is not working for me. I think it expects an actual URL and in this case, I don't really have one. The image data is just embedded in the JSON.
Is there a way to manipulate this so that I can add a name to the image for saving purposes?

Download pdf or image through ajax

I would like to send a lot of data through ajax request to my server which will generate pdf or jpg format according to that data.
Now i have done all that, my issue is to how output that generated pdf/jpg back to the user trough ajax? I guess i might be able to use json for that, but im not really sure how, and i think there would be a lot issues with pdf.
Also if some one gonna suggest using form with hidden inputs that will not work since i have really big multidimensional array with lot's of data and it would simply take to much effort to make it work.
By the way, i am using jquery, but anything else is acceptable as long as it does the job done without making me to rewrite half of my script.
To display a JPG
AJAX: You can return the data hex encoded (be sure to set the content type appropriately: header('Content-type: image/jpeg')). Then you just inject an <img/> element into the DOM and set it's src attribute to the returned Data URI.
HTML: Also, you could inject the <img/>'s with a normal src URL to some location on your server.
For PDF
It's a little more tricky. Some browsers display PDF's natively (Chrome/Firefox), others rely on optional third-party plugins. You can detect these plugins, but can't control whether the PDF is displayed in a window/frame or is downloaded.
If you choose to display, you can create a new window/tab to display it or display it in an iframe dynamically.

RDLC + ReportViewer Control - how to display images from the database?

I am storing GIF images (I can switch to BMP if necessary) in a varbinary column in SQL 2008. I want to display these images in a PDF rendered by the ReportViewer control from my RDLC.
How do I have to reference the image data in the report to make that work?
=First(Fields!sh_lot_num_barcode_image.Value, "DataSet1"))
A simple field reference does not seem to do the trick.
So it turns out my question was already asked before and self-answered. Give Tina your vote!
Together with Kevin's answer it got me on the right trail. I ended up adding a property to my Linq stored procedure results class that invokes the image HTML Handler. I changed the MIME type to BMP and it works like a charm - I can drop the database column now and don't need to jump through hoops to compose the URL for the image service. This property below I can directly assign to the image control.
public byte[] NDCLabel {
get {
return
BarcodeUtilities.ConvertImageToByteArray(
BarcodeUtilities.GetBarcodeImage(this.ndc)
,System.Drawing.Imaging.ImageFormat.Bmp);
}
}
Have you considered writing an HTTP Handler to read the image from the database and write it to the response stream? Then you can set the image control in your report to use the URL as the source and it should render in the output.
I don't have any actual images as blobs in a database to test with, but I did something sorta similar when I needed to render rich text on a report.

Resources