KDE Bug Tracking System
Home
Report New Wish or Bug
Query Existing Reports
First
Last
Prev
Next
No search results available
Search page
Bug
143029
:
Resizing an image make appearing a transparent ...
P
roduct
:
krita
Co
m
ponent
:
general
Status
:
RESOLVED
Resolution
:
FIXED
Target
:
---
Version
:
unspecified
Pr
i
ority
:
NOR
Severity
:
normal
V
otes
:
5
Description
:
Opened:
2007-03-15 22:38
Last Changed:
2007-05-25 16:06:23
Version: svn branch 1.6 and trunk (using KDE Devel) Installed from: Compiled sources Open a picture, resize it, and then there is a transparent border. Expected behaviour: no transparent pixel should appears
Comment
#1
Casper Boemann 2007-05-25 16:06:22
SVN commit 668216 by boemann: Fix scale of image so it leaves no transparent borders. BUG:143029 M +9 -4 core/kis_transform_worker.cc M +3 -2 core/kis_transform_worker.h M +1 -1 plugins/viewplugins/imagesize/imagesize.cc --- branches/koffice/1.6/koffice/krita/core/kis_transform_worker.cc #668215:668216 @@ -299,7 +299,7 @@ ~FilterValues() {delete [] weight;} }; -template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, KisPaintDevice *dst, double floatscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy) +template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, KisPaintDevice *dst, double floatscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha) { Q_INT32 lineNum,srcStart,firstLine,srcLen,numLines; Q_INT32 center, begin, end; /* filter calculation variables */ @@ -484,6 +484,11 @@ } data = dstIt.rawData(); cs->mixColors(colors, filterWeights[center&255].weight, filterWeights[center&255].numWeights, data); + + //possibly fix the alpha of the border if user wants it + if(fixBorderAlpha && (i==0 || i==dstLen-1)) + cs->setAlpha(data, cs->alpha(&tmpLine[(center>>8)*pixelSize]), 1); + data = dstSelIt.rawData(); *data = selectedness; } @@ -630,7 +635,7 @@ return false; } - transformPass <KisHLineIteratorPixel>(srcdev, tmpdev2, xscale, yscale*xshear, 0, m_filter); + transformPass <KisHLineIteratorPixel>(srcdev, tmpdev2, xscale, yscale*xshear, 0, m_filter, m_fixBorderAlpha); if(m_dev->hasSelection()) m_dev->selection()->clear(); @@ -640,7 +645,7 @@ } // Now do the second pass - transformPass <KisVLineIteratorPixel>(tmpdev2.data(), tmpdev3.data(), yscale, yshear, ytranslate, m_filter); + transformPass <KisVLineIteratorPixel>(tmpdev2.data(), tmpdev3.data(), yscale, yshear, ytranslate, m_filter, m_fixBorderAlpha); if(m_dev->hasSelection()) m_dev->selection()->clear(); @@ -651,7 +656,7 @@ } if (xshear != 0.0) - transformPass <KisHLineIteratorPixel>(tmpdev3, m_dev, 1.0, xshear, xtranslate, m_filter); + transformPass <KisHLineIteratorPixel>(tmpdev3, m_dev, 1.0, xshear, xtranslate, m_filter, m_fixBorderAlpha); else { // No need to filter again when we are only scaling --- branches/koffice/1.6/koffice/krita/core/kis_transform_worker.h #668215:668216 @@ -36,7 +36,7 @@ KisTransformWorker(KisPaintDeviceSP dev, double xscale, double yscale, double xshear, double yshear, double rotation, Q_INT32 xtranslate, Q_INT32 ytranslate, - KisProgressDisplayInterface *progress, KisFilterStrategy *filter); + KisProgressDisplayInterface *progress, KisFilterStrategy *filter, bool fixBorderAlpha=false); ~KisTransformWorker(); public: @@ -46,7 +46,7 @@ private: // XXX (BSAR): Why didn't we use the shared-pointer versions of the paint device classes? - template <class T> void transformPass(KisPaintDevice *src, KisPaintDevice *dst, double xscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy); + template <class T> void transformPass(KisPaintDevice *src, KisPaintDevice *dst, double xscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy, bool fixBorderAlpha); public: void rotateNone(KisPaintDeviceSP src, KisPaintDeviceSP dst); @@ -68,6 +68,7 @@ Q_INT32 m_progressStep; Q_INT32 m_progressScaler; Q_INT32 m_lastProgressReport; + bool m_fixBorderAlpha; }; --- branches/koffice/1.6/koffice/krita/plugins/viewplugins/imagesize/imagesize.cc #668215:668216 @@ -106,7 +106,7 @@ if (dlgImageSize->scale()) { m_view->scaleCurrentImage((double)w / ((double)(image->width())), (double)h / ((double)(image->height())), - dlgImageSize->filterType()); + dlgImageSize->filterType(), true); } else { m_view->resizeCurrentImage(w, h, dlgImageSize->cropLayers());
P
latform
:
Compiled Sources
O
S
:
Linux
K
eywords
:
People
Reporter
:
Cyrille Berger
Assigned To
:
Casper Boemann
Related actions
View Bug Activity
Format For Printing
XML
Clone This Bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Attachments
Add an attachment
(proposed patch, testcase, etc.)
Depends on
:
B
locks
:
Show dependency tree
-
Show dependency graph
First
Last
Prev
Next
No search results available
Search page
Actions
Reports
Requests
Reports
Bugs reported today
Bugs reported in the last 3 days
Bug reports with patches
Weekly Bug statistics
The most hated bugs
The most severe bugs
The most frequently reported bugs
The most wanted features
Junior Jobs
Report ownership counts and charts
My Account
New Account
Log In