BookmarkSubscribeRSS Feed
Filipvdr
Pyrite | Level 9

Hello,

Is it possible to save a thumbnail in a SAS dataset as binary data?

Is it then possible to show this thumbnail in a SAS Stored Process?

I find not many information... any help here?

Thanks

Filip

4 REPLIES 4
LinusH
Tourmaline | Level 20

There is no data type (such as BLOB) in SAS that handle binary object as is. Maybe you can accomplish this with some tweaking.

But why do you want to store this in a SAS table? Perhaps you can solve this by using an webDAV or other alternatives available with the web application server?

Data never sleeps
Cynthia_sas
SAS Super FREQ

Hi:

  In addition to LinusH's suggestion, while you cannot save the thumbnail, itself, in a SAS dataset, you could create a character variable that contained the URL to, or the server location of, the image file. For example, let's say that you wanted to display a picture of an employee in a report, next to their name/phone number. Assuming that

1) you had the picture files stored on a server accessible to the stored process server or workspace server in some organized fashion:  employee 111 pix is stored as 111.jpg, employee 222 pix is stored as 222.jpg, etc

and

2) you were returning the stored process results to a client application (such as the Information Delivery Portal or the Stored Process Web App) that would render the images inside stored process results

then

3) you could use the ODS style attribute PREIMAGE or POSTIMAGE to either point to a pre-built file location in a character variable or you could assemble the PREIMAGE location from the employee id

IF

your client application had server/file accessibility and is able to render the image style attributes, then the image would be displayed in your report/results.

In this case, you would not actually "show the thumbnail in a SAS Stored Process", but would cause your stored process results to contain a pointer to the image file location using a style attribute, so that, when the results were rendered in the client application, the image was displayed inside the stored process results. This may be something to work on with Tech Support -- client application ability to render the image style attributes will be critical to making this work.

cynthia

Filipvdr
Pyrite | Level 9

Hi Cynthia,

I will explain a bit more our application.

User has a picture, saves it via .NET application. The .NET application stores the picture at secret location. .NET passes metadata and a Reference ID to a SAS Stored process which saves the data in a table.

When the User wants to see his pictures again he clicks on a link and the .NET application returns the image.

I am able to do the following:

data _null_;

file _webout;

put "<img src=http://winiis1.imec.be:8080/eDocFileManager/FileService.svc/DownloadFile/1439/F7_S1_02-13-2012_06-02... width=150>";

run;

But when I want to build a search functionallity and it returns 100 pictures, it is going to take a while to load all big JPEG,BMP,... so we want thumbnails.

The goal is to also pass the binary information to save in the metadata table. And later in the HTML report to show the thumbnails. If thumbnail is clicked then show the real big picture (so that i already have).

I don't find any information about this topic, I also opened a call to Tech Support.

FriedEgg
SAS Employee

There are plenty of ways to accomplish what it appears that you are trying to do.  There are a few things to consider that I will say quickly:

You will need a mid-tier application to perform the thumbnail creations, there are lots of options for this, like imagemagick which is a fairly common application for this type of work:

http://www.imagemagick.org/script/index.php

You can then follow a similar excersie to what Cynthia posted except go one more display the newly created thumbnail image as a link to the url for the associated larger image.

As far as storing the binary information is concerned you will most likely experience problems attempting to store this in a SAS dataset considering it is highly likey that a large image file, espeically in binary format far exceeds the maximum length to store in a single column as least.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1473 views
  • 0 likes
  • 4 in conversation