Profile picture for user freddy

Good day,

I want to save a Model Image to a SQL Database, but the only way I can do this is to first call the Save method on the IPicture interface. This causes the image to be saved on the disk. From there I can use the image file to save it to the SQL Database. 

The only problem I have with this way is that it takes to long, I don't need it to be saved to the disk first.

Here is my code (Not Complete):

IPicture aModelPic = (IPicture) aModel.Graphic(false, false, mnLanguage);

//Save the Model Image to disk
aModelPic.Save(msPicsPath + "\\" + aModel.GUID() + ".png");

//Read the Model Image from disk to a ByteArrayInputStream 
File fModelImg = new File(msPicsPath + "\\" + aModel.GUID() + ".png");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
BufferedImage bufImg = ImageIO.read(fModelImg);
ImageIO.write(bufImg, "png", baos);
byte[] byteImage = baos.toByteArray();
ByteArrayInputStream inStream = new ByteArrayInputStream(byteImage);

//ready to write ByteArrayInputStream to SQL DB
PreparedStatement pstmt = mcxnDB.prepareStatement(msSql);

pstmt.setBinaryStream(1,inStream,inStream.available());
			
pstmt.executeUpdate();
pstmt.close();

What I need is a way to get either a InputStream or ImageInputStream directly from the IPicture interface to pass to ImageIO.read().

Is there a way to achieve this?

by Torsten Haase
Posted on Wed, 03/16/2011 - 11:28

Hi,

at the moment no possibility exists to access the image file data without saving the picture first.

BR, Torsten

0
by Johan Schoeman
Posted on Thu, 03/17/2011 - 14:35

Hi Torsten

Thanks for the response.  Is there any way that we can request that this feature is added to the next release of ARIS?  What is the process we need to follow to request features such as this?

Thanks,

Johan Schoeman

0
by Torsten Haase
Posted on Thu, 03/17/2011 - 17:52

Hi Johan,

feel free to post this feature request to ARIS support. It will not make it into ARIS 7.2, which will be released soon, but hopefully in one of the upcoming service releases.

BR,

Torsten

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock