dwgoon / jpegio

A python package for accessing the internal variables of JPEG file format such as DCT coefficients and quantization tables
Apache License 2.0
73 stars 18 forks source link

how to process base64_str? #33

Open stormcoral opened 1 month ago

stormcoral commented 1 month ago

Is it possible to directly read in a base64 without saving a temporary file?

detrin commented 1 month ago

No, I don't think that is possible in this package. Why don't you want to use a temporary file?

Do you think this would solve your issue?

import base64
import io
import jpegio

base64_string = '...'
image_bytes = base64.b64decode(base64_string)
image_buffer = io.BytesIO(image_bytes)
jpg = jpegio.read(image_buffer)
stormcoral commented 1 month ago

@detrin it will throw an error.

detrin commented 1 month ago

@detrin it will throw an error.

@stormcoral Can you provide details?