diff options
| author | Mike Wey | 2012-04-09 14:55:32 +0200 |
|---|---|---|
| committer | Mike Wey | 2012-04-09 14:55:32 +0200 |
| commit | 6f9b99fd01c4d52f3fbc4936ccf9f1b7d892307f (patch) | |
| tree | 642e02627b4cb0ac3459dbb2a4aa2581559792a8 | |
| parent | 811e5806d29c0856b182c278ec544a7fe4be4175 (diff) | |
Set the filename correctly for Image.toBlob.
| -rw-r--r-- | dmagick/Image.d | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dmagick/Image.d b/dmagick/Image.d index ea74403..d1e7205 100644 --- a/dmagick/Image.d +++ b/dmagick/Image.d @@ -2968,6 +2968,10 @@ class Image if ( depth != 0 ) this.depth = depth; + string originalFilename = filename; + filename = this.magick ~ ":"; + scope(exit) filename = originalFilename; + void* blob = ImageToBlob(options.imageInfo, imageRef, &length, exceptionInfo); DMagickException.throwException(exceptionInfo); @@ -2978,6 +2982,12 @@ class Image return dBlob; } + unittest + { + Image example = new Image(Geometry(100, 100), new Color("green")); + example.toBlob("jpg"); + } + /** * Changes the opacity value of all the pixels that match color to * the value specified by opacity. By default the pixel must match @@ -3718,7 +3728,7 @@ class Image ///ditto string filename() const { - return to!(string)(imageRef.filename); + return imageRef.magick[0 .. strlen(imageRef.magick.ptr)].idup; } /** |
