做完base64后,发现总是报错image format error
qt base64 url encode
发现:https://developer.baidu.com/forum/topic/show/244140
qt base64 url encode
Qt中需要稍微转换一下

QByteArray toBase64(QString imgPath) {
    QImage image(imgPath);
    QByteArray ba;
    QBuffer buf(&ba);
    image.save(&buf, "png");
    QByteArray hexed = ba.toBase64();
    buf.close();
    return hexed;
}
toBase64(imgPath).toPercentEncoding()

核心是toPercentEncoding
qt base64 url encode

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-11-18
猜你喜欢
  • 2021-06-05
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案