mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-21 16:47:07 +02:00
fixed index images crop in PhotoCropBox
This commit is contained in:
parent
bbeac7509f
commit
17e9cd0f6d
1 changed files with 5 additions and 1 deletions
|
@ -267,7 +267,11 @@ void PhotoCropBox::onSend() {
|
|||
iw = from.height() - iy;
|
||||
}
|
||||
int32 offset = ix * from.depth() / 8 + iy * from.bytesPerLine();
|
||||
QImage cropped(from.bits() + offset, iw, iw, from.bytesPerLine(), from.format()), tosend;
|
||||
QImage cropped(from.constBits() + offset, iw, iw, from.bytesPerLine(), from.format()), tosend;
|
||||
if (from.format() == QImage::Format_Indexed8) {
|
||||
cropped.setColorCount(from.colorCount());
|
||||
cropped.setColorTable(from.colorTable());
|
||||
}
|
||||
if (cropped.width() > 1280) {
|
||||
tosend = cropped.scaled(1280, 1280, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else if (cropped.width() < 320) {
|
||||
|
|
Loading…
Add table
Reference in a new issue