compare 2 image based on based64 byte array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 04:34 AM
Hello my friends,
In my current project I got some issue with Helsinki.
I want to compare 2 image using byte array (based64) in Geneva instance and it is working fine but after upgrade to Helsinki this same code didn't work... Have you got similar problems ?
Attachment is a Glide Record to sys_attachment;
var att = Attachment.sys_id;
var binData = new GlideSysAttachmentInputStream(att);
var atm = '';
var bytearrayOS = new Packages.java.io.ByteArrayOutputStream();
binData.writeTo(bytearrayOS); <-- in this i got problem
atm = GlideBase64.encode(bytearrayOS.toByteArray());
Maybe you have other methods to compare 2 images ?
Best regards,
Artur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 04:43 AM
Hello Artur,
Take a look at the GlideSysAttachment() API. It contains updated methods to get your content in base64. I was working with it a bit last week, but ultimately my work went in another direction and I ended up note using it. It might prove more compatible than the legacy/deprecated Packages calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 05:19 AM
Thanks for answer
I try GlideSysAttachment.getContentBase64(<record sys_id>); and didn't work either

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2017 06:39 AM
var StringUtil = GlideStringUtil;
var gsa = new GlideSysAttachment();
StringUtil.base64Encode(gsa.getBytes(gr))
For converting image to base64 you can use above method, but not sure if you were able to figure out way to compare Base64 encoded data for two images.
Regards,
Rohant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2017 12:21 AM
Hi Rohant,
Thx for answer, I make workaround but I will check your solution later.
Problem was that every single imgae was attach to attachment in ticket. When we got many sends and answer on this same email (conwersation) we got same image many times. This example is for footers.