I am trying to perform .getvalue() operation on PIL image on AWS Lambda to extract the bytes of PIL Image but my byte string length is different when i perform this operation on Local Machine and Its different when i Perform it on AWS Lambda, below is code
if base64_message[0:4] == b'%PDF':
images = convert_from_bytes(base64_message, dpi=120, poppler_path=poppler_path)
img_byte_arr = io.BytesIO()
for img_page in (images):
img_page.save(img_byte_arr, format = "jpeg")
break
img_obj = img_byte_arr.getvalue()
**print(len(img_obj))**
Basically I am trying using pdf2image library to get image byte from pdf but length of the bytes are different on Local Machine and its Different on AWS lambda which impacting by futher operation.
for particular Image, length of Imagebyte on AWS Lambda is 122103 and for same image it's 122551 on Local Machine.
Solution - After making some research i figured out that this issue is happening due to Lambda Linux Environment and i developed my entire application on Windows Machine, so different operating system is the issue.