Closed Zstro closed 5 months ago
It is a shame that GetImageBlob
and GetImagesBlob
don't check for an error and return an extra error value. If we changed that now, it would be a breaking api change. So we have a few options:
GetLastError
GetImageBlobErr() []byte, error
For your second question, I am not sure where that error is supposed to be generated from the ImageMagick api. If you check GetLastError
immediately after the call to GetImageBlob
does it produce the expected webp error? Would fixing your first question also fix the second?
I'm sorry for not recovering in time, interrupted by other things. For q2, i think it should error in setImageFormat, but i caught error in goroutine after executing GetImageBlob(), and the main func couldn't exec in order.
I don't fully understand you last example. Why are you trying to catch the error in a tight loop in a goroutine instead of just checking GetLastError after your call to GetImageBlob? You seem to just move on to the next call.
My point was asking whether you can get the error with GetLastError right after GetImageBlob
I can't get error after GetImageBlob, func was interrupted without any result.
I don't fully understand you last example. Why are you trying to catch the error in a tight loop in a goroutine instead of just checking GetLastError after your call to GetImageBlob? You seem to just move on to the next call. My point was asking whether you can get the error with GetLastError right after GetImageBlob
If you can provide a reproduction of this error (code and source image) then I will look at improving the error handling. Otherwise this ticket might be closed.
i find some question when debugging.
q1, as shown in the figure, ImageMagick report error when GetImageBlob(). i think GetImageBlob() should report it.
q2, i got error
convert: partition 0 overflow (> 512K)
from convert and got nothing with GetImageBlob().