This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Different sizes in array of byte from captchas  RSS feed

 
Ranch Hand
Posts: 95
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys.

I have 2 captcha images, from the same site (but different symbols). Both of them are jpg. I have a method that converts that images to array of bytes. So far so good.
When I use that method over captchaOne, it returns X as the size of the array. When I use that method over captchaTwo, it returns Y as the size of the array. Is that correct? I mean, I'm feeling that that is the mechanism over the captchas... But there's gotta be a way to get the same byte array (with different values, obviously) from different images... Can you guys help me?

Thanks! And I'm sorry about my poor english.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why JPGs of the same image size (like in pixels) would be the same length; JPGs are compressed, so file size won't match image size one-to-one.

I might be misunderstanding your question, though.
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure who we are able to help you. The only information that you have provided is that the images is a jpg
and that the method returns two different array sizes.

Which method are you using?
How is the method converting it?
What is the size of the image?
What is the output that you expected and what are you really getting?
Etc...

You need to provided us more information. What do you want to do with those byte arrays? Because if you want to
solve the captcha you should look for OCR software.
 
Andre Brito
Ranch Hand
Posts: 95
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... David, I guess you're completely right... The length of the array is, de facto, the size of the image. I'll try a new approach (maybe a 2 dimensional array of pixels or something like that).

By the way, I'm trying to pass an array from Java to other technology (through the network, with rmi and jni), so I thought that if I passed the things like that it would be ok... Maybe I'll try another approach in receiving the array in the other side of the application.
 
Men call me Jim. Women look past me to this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!