Graceful failing on missing data
This commit is contained in:
+6
-2
@@ -125,8 +125,12 @@ public:
|
||||
class Watermark : public Mutation {
|
||||
public:
|
||||
Watermark() {
|
||||
watermark = new Image;
|
||||
watermark->read("watermark.png");
|
||||
try {
|
||||
watermark = new Image;
|
||||
watermark->read("watermark.png");
|
||||
} catch ( Magick::ErrorFileOpen &error ) {
|
||||
watermark = new Image("40x40", "white");
|
||||
}
|
||||
}
|
||||
Image * getMutated(Image* img) {
|
||||
Image* mut = new Image(*img);
|
||||
|
||||
Reference in New Issue
Block a user