Home Compare Image Size in KB in Java
Reply: 0

Compare Image Size in KB in Java

user4756 Published in September 19, 2018, 11:03 am

I am using an api which gives me the size of an image, such as 200KB (can be MBs also). Now I need to perform some action on images below a specific size. What I am trying to achieve is something like this:

String imgSize = img.getSize();
if(imgSize < 250KB) {
  // Do Something

I can't use the relational operator here. What could be the best way to achieve this?

share|improve this question

3 Answers 3

active oldest votes
up vote 3 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.377876 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO