Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:17:33+00:00 2026-05-22T15:17:33+00:00

I´m trying to send a image through tcp to a server, firts getting the

  • 0

I´m trying to send a image through tcp to a server, firts getting the buffer from the camera and then converting to grayScale the buffer, finally I send the buffer to the server.
All is working fine, but the problem is that the image that the server receive it is not 100 % okay, it looks like there is some padding that I dind´t use at the conversion, all the images are more or less than the next.
I use the next code to get the image:
VImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);

uint8_t * baseAddress = (uint8_t *)CVPixelBufferGetBaseAddress(imageBuffer);

the image is here http://s3.subirimagenes.com:81/imagen/previo/thump_6421684image001.png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:17:34+00:00Added an answer on May 22, 2026 at 3:17 pm

    The only padding you may get is per row of pixels — you should use something like:

    /* ... */
    uint8_t *baseAddress = (uint8_t *)CVPixelBufferGetBaseAddress(imageBuffer);
    size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer);
    
    for(interesting values of y)
    {
        uint8_t *pointerToThisLine = baseAddress + bytesPerRow*y;
    }
    

    Rather than assuming, one way or another, that one scanline ends somewhere in memory and then the next immediately starts.

    That said, the top portion of your image is clearly correct and I’ve yet to see an instance where pitch wasn’t equal to width*bytesPerPixel, so it’d be unlikely to be causing your problem in practice even if you haven’t done that correctly.

    Inspecting your image, it looks like the broken region contains copies of various fragments of the working region, so I don’t think the problem is padding related — it’s some sort of more obtuse memory management or transmission error. Have you checked that side of things?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an image from a Java desktop application to a
I'm trying to send a single image from my iPhone app to my Google
I'm trying to load an image file into a buffer in order to send
I'm trying to send an image using a Java server to my Android device
I am trying to send email through gmail using PHPMailer_V5.1. Getting the following error,
I'm trying to send an image to a server, using HTTP Post Multipart. Everything
I am trying to send my dynamically created silverlight 2 page/image to a an
I am trying to receive an image from the Android Gallery via an ACTION_SEND
I am trying to send an email from a site I am building, but
I am trying to send an email message with data collected from an html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.