问题
Is there a way to resize an image without having it previously written to storage? I am using a pdf library that for the images needs the bytes of it.
What I do is get image with an http.get and I get the bytes to put it in the pdf. The problem is that I need to resize the image BEFORE putting it in the pdf.
The only thing I have is the url of the image or the uint8list
Response response = await http.get(imageUrl);
Uint8List imgBytes = response.bodyBytes;
Later:
Image(
PdfImage.file(pdf.document,
bytes: imageBytes)
),
Pdf lib I use: https://pub.dev/packages/pdf
来源:https://stackoverflow.com/questions/63063906/flutter-resize-network-image