Fixing some undefined behaviour part 2, Issue 2277
This commit is contained in:
@@ -525,10 +525,10 @@ void ImProcFunctions::transformLuminanceOnly (Imagefloat* original, Imagefloat*
|
|||||||
for (int y=0; y<transformed->height; y++) {
|
for (int y=0; y<transformed->height; y++) {
|
||||||
double vig_y_d = (double) (y + cy) - vig_h2 ;
|
double vig_y_d = (double) (y + cy) - vig_h2 ;
|
||||||
for (int x=0; x<transformed->width; x++) {
|
for (int x=0; x<transformed->width; x++) {
|
||||||
double vig_x_d = (double) (x + cx) - vig_w2 ;
|
|
||||||
double r = sqrt(vig_x_d*vig_x_d + vig_y_d*vig_y_d);
|
|
||||||
double factor = 1.0;
|
double factor = 1.0;
|
||||||
if (applyVignetting) {
|
if (applyVignetting) {
|
||||||
|
double vig_x_d = (double) (x + cx) - vig_w2 ;
|
||||||
|
double r = sqrt(vig_x_d*vig_x_d + vig_y_d*vig_y_d);
|
||||||
if(darkening)
|
if(darkening)
|
||||||
factor /= std::max(v + mul * tanh (b*(maxRadius-r) / maxRadius), 0.001);
|
factor /= std::max(v + mul * tanh (b*(maxRadius-r) / maxRadius), 0.001);
|
||||||
else
|
else
|
||||||
|
@@ -860,7 +860,10 @@ class SALensIDInterpreter : public IntLensInterpreter< int > {
|
|||||||
double *liArray = NULL;
|
double *liArray = NULL;
|
||||||
if (lensInfoTag)
|
if (lensInfoTag)
|
||||||
liArray = lensInfoTag->toDoubleArray();
|
liArray = lensInfoTag->toDoubleArray();
|
||||||
return guess( lensID, focalLength, maxApertureAtFocal, liArray);
|
std::string retval = guess( lensID, focalLength, maxApertureAtFocal, liArray);
|
||||||
|
if(liArray)
|
||||||
|
delete [] liArray;
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
SALensIDInterpreter saLensIDInterpreter;
|
SALensIDInterpreter saLensIDInterpreter;
|
||||||
|
@@ -38,18 +38,19 @@
|
|||||||
// Profile name to use for internal values' profile
|
// Profile name to use for internal values' profile
|
||||||
#define DEFPROFILE_INTERNAL "Neutral"
|
#define DEFPROFILE_INTERNAL "Neutral"
|
||||||
|
|
||||||
class SaveFormat {
|
class SaveFormat {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Glib::ustring format;
|
Glib::ustring format;
|
||||||
int pngBits;
|
int pngBits;
|
||||||
int pngCompression;
|
int pngCompression;
|
||||||
int jpegQuality;
|
int jpegQuality;
|
||||||
int jpegSubSamp; // 1=best compression, 3=best quality
|
int jpegSubSamp; // 1=best compression, 3=best quality
|
||||||
int tiffBits;
|
int tiffBits;
|
||||||
bool tiffUncompressed;
|
bool tiffUncompressed;
|
||||||
bool saveParams;
|
bool saveParams;
|
||||||
};
|
SaveFormat () : format("jpg"), jpegQuality(90), jpegSubSamp(2), pngCompression(6), pngBits(8), tiffBits(8), tiffUncompressed(true), saveParams(true) {};
|
||||||
|
};
|
||||||
|
|
||||||
enum ThFileType {FT_Invalid=-1, FT_None=0, FT_Raw=1, FT_Jpeg=2, FT_Tiff=3, FT_Png=4, FT_Custom=5, FT_Tiff16=6, FT_Png16=7, FT_Custom16=8};
|
enum ThFileType {FT_Invalid=-1, FT_None=0, FT_Raw=1, FT_Jpeg=2, FT_Tiff=3, FT_Png=4, FT_Custom=5, FT_Tiff16=6, FT_Png16=7, FT_Custom16=8};
|
||||||
enum PPLoadLocation {PLL_Cache=0, PLL_Input=1};
|
enum PPLoadLocation {PLL_Cache=0, PLL_Input=1};
|
||||||
|
Reference in New Issue
Block a user