Hi Nuwan, am +1 for the second option of retrieving the image as a binary stream too. There are approaches which can be used and at the moment in use also to represent an image using the binary information. IMO your concern regarding this option will not be an issue.
Thanks and Best Regards, On Tue, Jan 16, 2018 at 11:41 AM, Ruwan Yatawara <[email protected]> wrote: > I am +1 for the second option of retrieving the image as a binary stream. > > Given the fact that images can be of varying sizes (talking about > high-resolution ones, here), and Sidhdhi not having any image processing > capabilities as of this moment, I do not see a clear advantage in using a > SIdhdhi stream for storage and retrieval. > > Thanks and Regards, > > Ruwan Yatawara > > Technical Lead, > WSO2 Inc. > > email : [email protected] > mobile : +94 77 9110413 > http://ruwansrants.blogspot.com/ > https://500px.com/ruwan_ace > https://medium.com/@ruwanyatawara > > > On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene <[email protected]> > wrote: > >> Hi all, >> >> I'm currently working on a project to add image storing and retrieval >> capabilities to the WSO2 IoT Server. >> >> To achieve this I have implemented the following; >> 1) Added a separate DAO Table with a field with LONGBLOB data type for >> storing. >> 2) Added storage capabilities in the database for an image sent as a *File >> *in the form of a *BinaryStream*. >> >> As of now, I've written unit tests and the test images are getting stored >> successfully in the database. >> >> The problem lies in how to successfully retrieve the stored data. For >> this, I have come across 2 possible approaches. >> 1) *Retrieve as a File - *The notable downside I realized with this >> solution is that each time a new Image is retrieved, a new file will be >> created. Therefore measures would have to be taken to persist new files >> while purging older obsolete ones. >> 2) *Retrieve as BinaryStream - *Although this requires no persistent >> memory usage and the data will only be retrieved on call and issues may >> come up when representing that data from a UI end. Further analysis is >> required for this approach. >> 3) *Retrieve as FileOutputStream - *This is my preferred method and the >> one recommended mostly in forums and tutorials. >> >> One other approach suggested to me was to use a *Siddhi Stream for both >> storage and retrieval* purposes. This would further allow for analytics >> to be performed on the data which not be very much possible with the >> earlier mentioned approaches. >> >> Suggestions and Feedback are appreciated. >> Thanks and regards! >> >> -- >> *Nuwan Jayawardene* >> *Software Engineering Intern* >> *WSO2, Inc.:http://wso2.com <http://wso2.com/>* >> *lean.enterprise.middleware* >> *Mobile :- +94 71 1813299 <+94%2071%20181%203299>* >> >> >> - *Linkedin* *:- **https://www.linkedin.com/in/nuwa >> <https://www.linkedin.com/in/nuwanjaya/>**njaya/ >> <https://www.linkedin.com/in/nuwanjaya/>* >> - * <https://www.wso2.com/signature>* >> >> > -- > You received this message because you are subscribed to the Google Groups > "WSO2 IoT Team Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/a/wso2.com/d/optout. > -- Kamidu Sachith Punchihewa *Senior Software Engineer* WSO2, Inc. lean . enterprise . middleware Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194> Disclaimer: This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, retransmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
