summaryrefslogtreecommitdiff
path: root/libopie2/opiemm
Side-by-side diff
Diffstat (limited to 'libopie2/opiemm') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiemm/oimagescrollview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie2/opiemm/oimagescrollview.cpp b/libopie2/opiemm/oimagescrollview.cpp
index 10da823..76f50e1 100644
--- a/libopie2/opiemm/oimagescrollview.cpp
+++ b/libopie2/opiemm/oimagescrollview.cpp
@@ -202,12 +202,13 @@ void OImageScrollView::setAutoScale(bool how)
{
m_states.setBit(AUTO_SCALE,how);
_image_data = QImage();
if (ImageIsJpeg() && how == false && ImageScaledLoaded()==true) {
loadJpeg(true);
}
+ _newImage = true;
generateImage();
}
bool OImageScrollView::AutoScale()const
{
return m_states.testBit(AUTO_SCALE);
@@ -345,14 +346,16 @@ void OImageScrollView::rotate_into_data(Rotation r)
_image_data = dest;
}
// yes - sorry - it is NOT gamma it is just BRIGHTNESS. Alwin
void OImageScrollView::apply_gamma(int aValue)
{
- if (!_image_data.size().isValid()) return;
+ if (aValue==0 || !_image_data.size().isValid()) return;
float percent = ((float)aValue/100.0);
+ /* make sure working on a copy */
+ _image_data.detach();
int segColors = _image_data.depth() > 8 ? 256 : _image_data.numColors();
/* must be - otherwise it displays some ... strange colors */
if (segColors<256) segColors=256;
unsigned char *segTbl = new unsigned char[segColors];