Giter Club home page Giter Club logo

dmagick's People

Contributors

andrejmitrovic avatar finitemonkey avatar mikewey avatar wilsonjord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dmagick's Issues

Addition Flag required

I needed to add -version=ANSI to DFLAGS in order for it to compile with dmd 2.073.2 (windows).

Wrong modulepath when using dub

Having import dmagick.Image; in my source, this error occurs on dub run:

Running pre-generate commands for dmagick...
/home/wucke13/.dub/packages/dmagick-0.2.2/dmagick/
Performing "debug" build using dmd for x86_64.
dmagick 0.2.2: building configuration "other"...
image-indexer ~master: building configuration "application"...
source/app.d(15,8): Error: module `Image` is in file 'dmagick/Image.d' which cannot be read
import path[0] = source/
import path[1] = ../../../../.dub/packages/dmagick-0.2.2/dmagick/dmagick
import path[2] = /nix/store/l15g95dhsxz34faz588ylzyh0z440zxp-dmdBuild-2.081.2/include/d2
dmd failed with exit code 1.

It can be fixed by just import Image;, but then the other imports don't work:

Running pre-generate commands for dmagick...
/home/wucke13/.dub/packages/dmagick-0.2.2/dmagick/
Performing "debug" build using dmd for x86_64.
dmagick 0.2.2: building configuration "other"...
image-indexer ~master: building configuration "application"...
../../../../.dub/packages/dmagick-0.2.2/dmagick/dmagick/Image.d(21,8): Error: module `Color` is in file 'dmagick/Color.d' which cannot be read
import path[0] = source/
import path[1] = ../../../../.dub/packages/dmagick-0.2.2/dmagick/dmagick
import path[2] = /nix/store/l15g95dhsxz34faz588ylzyh0z440zxp-dmdBuild-2.081.2/include/d2
dmd failed with exit code 1.

`
Any idea how to fix this?

Funnily, the files are there:

$ ls ../../../../.dub/packages/dmagick-0.2.2/dmagick/dmagick 
Array.d      ColorCMYK.d  ColorHSL.d  DrawingContext.d  Image.d      Montage.d
c            Color.d      ColorRGB.d  Exception.d       ImageView.d  Options.d
CoderInfo.d  ColorGray.d  ColorYUV.d  Geometry.d        internal     Utils.d

format() call hijack and length comparison mismatch

dmagick.Image.d, Line 1357:

throw new ImageException(format("Pixel buffer needs more storage for %s channels.", map));

causes:
..\DMagick\dmagick\Image.d(1357): Error: function dmagick.Image.Image.format () const is not callable using argument types (string,string)

Image.format hijacked std.string.format, use this or introduce an alias:

throw new ImageException(std.string.format("Pixel buffer needs more storage for %s channels.", map));

Also, I think this comparison is not right:

if ( pixels.length <=  (area.width * area.height) * map.count )

it should be:

if ( pixels.length <  (area.width * area.height) * map.count )

There's no reason to fail if the buffer has the exact amount of space needed.

GetCacheViewVirtualPixels: Assertion failure

I'm using ImageMagick 6.7.7 and when I do the following:

Image i = new Image("pathToImage");
i.thumbnail(Geometry(150, 150));

I get the following error: magick/cache-view.c:729: GetCacheViewVirtualPixels: Assertion `id < (int) cache_view->number_threads' failed.

I already used the thumbnail()-method in a previous version of IM, but I can't get it to work with 6.7.7...

Image.crop add offset to image

import dmagick.Image;
import dmagick.Geometry;

void main(string[] s)
{
Image i = new Image("/tmp/300.png");

    int newW = cast(int)(i.view.width*0.85);
    int newH = cast(int)(i.view.height * 0.85);
    Geometry g = Geometry(newW,newH,(i.view.width-newW)/2,(i.view.height-newH)/2);

    i.crop(g);
    i.write("/tmp/cropped.png");

}

dmd 2.061 dmagick from trunk.
Ubuntu 12.10.

Try to open "cropped" image with gimp, it explains you the problem.

300
cropped

Core dump / Segfault

It's probably my fault - I'm just starting out with D so please be patient. The following is my attempt to compile and run the two examples shipped with DMagick. It's DMagick version 6.8.7. The attempt to run draw.d using rdmd instead of dmd just hung after the strange error message below... hence the ^C. I'm on Arch Linux... I think any other info you might want is below...

$ uname -a
Linux orion 3.11.6-1-ARCH #1 SMP PREEMPT Sat Oct 19 00:29:46 CEST 2013 i686 GNU/Linux

$ pkg-config --cflags --libs DMagick
-version=MagickCore_HDRI -I/usr/local/include/d/ -L-L/usr/local/lib/ -L-lDMagick -L-lMagickCore-6.Q16HDRI 

$ identify -version
Version: ImageMagick 6.8.7-1 2013-10-20 Q16 http://www.imagemagick.org
[snip]

$ dmd `pkg-config --cflags --libs DMagick` draw.d
$ ./draw
draw: malloc.c:2365: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted (core dumped)

$ rdmd `pkg-config --cflags --libs DMagick` draw.d
*** Error in `/tmp/.rdmd-1001/rdmd-draw.d-3DBCB9BFB2127CA5FC9FE08452FBD65A/draw': corrupted double-linked list: 0x087ff2a0 ***
^C

$ dmd sigmoidalContrast.d `pkg-config --cflags --libs DMagick`
$ ./sigmoidalContrast*
Segmentation fault (core dumped)

Any ideas?

Compiling on 64 bit (size_t abuse)

I've committed a quick fix at kf6kjg@d5eae0c

However, as noted in the commit log, the fix isn't the "correct" way, it only patches the direct problem.

The underlying issue is that size_t is designed for pointer use and changes definition per platform bit depth. Per the docs: size_t is an alias to one of the unsigned integral basic types, and represents a type that is large enough to represent an offset into all addressible memory.

There's also a mess of warnings in Exception.d about unreachable code in some mixins, but I'm ignoring that for now!

set image quality does not work

auto originalIMage = new Image(blob);
.....
originalIMage.resize(........);
originalIMage.quality(65);
originalIMage.toBlob();

but image quality does not work?
how can i do that?

string enums

Compiling DMagick in debug mode in Windows with dmd 2.056.

dmd does not compile the string enums in dmagick.DrawingContext (FontEncoding and FontWeight).

This does not occur in release build.
As a work-around I changed them to integer enums.

I don't know if it's a dmd bug, but as std.conv.to!string converts an enum value to the right string maybe you don't need string enums.

zero-length blob not permitted

DMgaick throw exception with message :
zero-length blob not permitted `' @ error/blob.c/BlobToImage/346 line:2398 file:source/dmagick/Image.d

how can I fixed it! thanks

ImageMagick 7?

I'm trying to resurrect an old project and either I'm doing something stupid or DMagick is not compatible with ImageMagick7. Please confirm that I'm not doing something stupid? I'm getting a whole load of undefined references during linking against libmagick 7.0.8 (QueryColorDatabase, AdaptiveBlurImageChannel, AdaptiveSharpenImageChannel, AddNoiseImageChannel... to name the first four).

YUV color doens't work properly

On docs I read 0 < Y < 1 -0.5 < u < 0.5 -0.5 < v < -0.5 .
BTW it doesn't work, some asserts (that check for 0 < u < 1) fail.

Fails to build on Mac.

I guess this is an M1 issue but still, here it is.

Running pre-generate commands for dmagick...
/Users/pavels/.dub/packages/dmagick-0.2.4/dmagick
Performing "tests" build using /Users/pavels/.local/share/ldc2/bin/ldc2 for aarch64, arm_hardfloat.
dmagick 0.2.4: building configuration "other"...
../../../../.dub/packages/dmagick-0.2.4/dmagick/dmagick/c/magickType.d(142,10): Error: undefined identifier `MagickFloatT`
/Users/pavels/.local/share/ldc2/bin/ldc2 failed with exit code 1.

The ImageMagick is installed via Mac ports, version: 6.9.11-60_1+x11.

Error: undefined identifier MagickLibVersion in cache.d and random.d

"make" always throws the following errors:

dmagick/c/cache.d(22): Error: undefined identifier MagickLibVersion
dmagick/c/random.d(22): Error: undefined identifier MagickLibVersion
dmagick/c/random.d(31): Error: undefined identifier MagickLibVersion

Simply add "import dmagick.c.magickVersion;" in dmagick/c./cache.d and dmagick/c/random.d...

Image procesing programmatically

Does it currently support image processing functions like scaling, conversion and reducing quality programatically (uisng the API)?

TIFF Warning throws exception

Picture taken using scanner won't load... It works works with "convert" and other imagemagick based tools (they give the same warning) but dmagick thrown exception. Is this the expected behaviour?

dmagick.Exception.CoderException@dmagick/Image.d(2285): Auto-corrected former TIFF subsampling values [2,2] to match subsampling values inside JPEG compressed data [2,1]. `JPEGFixupTagsSubsamplingSec' @ warning/tiff.c/TIFFWarnings/768

I can't attach TIFF image here...

DMagick is always rebuilt even if a rebuild is not needed

During the DMagick pre-build time, the file dmagick/c/magickVersion.d is recreated, resulting in an updated mtime for that file, which triggers a rebuild of DMagick every time regardless of whether there are any actual changes to any DMagick files.

In order to fix this, I have modified my own dmagick/build-aux/magickVersion.sh like so;

if [ ! -f "$PACKAGE_DIR/dmagick/c/magickVersion.d" ]; then
     ... sed operations ...
fi

i.e. if the file has already been created, don't create it again.

However, I suspect that the solution above won't work generally, as it will mean that if the version of MagickCore is changed on the system, it will not be picked up and trigger a rebuild of DMagick, possibly resulting in breakage? Is that the case and the reason why things are as they are?

If so, I thought that perhaps a way around that problem would be to write the version number(s) out to another file when first retreived, then read that in if it exists (on subsequent runs) and if the numbers have changed, regenerate magickVersion.d, otherwise skip any writing of files. Would that work? I would be happy to write it if so and if it would help.

ImageView.d(166): found ';' when expecting ','

I got the following error by after calling "make":

dmagick/ImageView.d(166): found ';' when expecting ','

... simply remove ";" between );) or replace the line with the following:

int result = dg(Pixels(image, extent.x, row, extent.width, 1));

Would be also great if Mike can solve this issue.

Make this project a work with DUB?

Hi,

I would like to know if you have plans on using dub to distribute this and make it easier for developers to implement this into their application.

Image.toBlob Segfaults.

nrgyzer wrote on the D newsgroup:

When I try the following:

Image example = new Image(Geometry(100, 100), new ColorRGB(0, 255, 0));
example.toBlob();

I get an access violation. Do I anything wrong or is it a bug? (I'm using Imagick 6.7.6, DMD64 and CentOS)

dub package installation problems under Ubuntu 16.04

Add dmagick to dependencies to my dub.json.

Problem #1: build-aux/magickVersion.sh is not runnable so we have 'Permission denied'.
Fix: chmod +x ~/.dub/packages/dmagick-0.2.0/build-aux/magickVersion.sh

Problem #2: it tried to compile Windows version and failed:
dmagick 0.2.0: building configuration "other"...
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(23,13): Error: undefined identifier 'WNDCLASS'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(24,13): Error: undefined identifier 'HINSTANCE'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(25,13): Error: undefined identifier 'BITMAPINFO'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(26,13): Error: undefined identifier 'HWND'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(27,13): Error: undefined identifier 'MSG'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(29,22): Error: undefined identifier 'HWND'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(113,41): Error: undefined identifier 'LRESULT'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(113,41): Error: undefined identifier 'HWND'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(113,41): Error: undefined identifier 'UINT'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(113,41): Error: undefined identifier 'WPARAM'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(113,41): Error: undefined identifier 'LPARAM'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(214,12): Error: undefined identifier 'DWORD'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(215,11): Error: undefined identifier 'UINT'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(217,22): Error: undefined identifier 'BOOL'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(217,22): Error: undefined identifier 'HDC'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(217,22): Error: undefined identifier 'HDC'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(217,22): Error: undefined identifier 'DWORD'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(218,25): Error: undefined identifier 'HBITMAP'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(218,25): Error: undefined identifier 'HDC'
../../.dub/packages/dmagick-0.2.0/dmagick/dmagick/internal/Windows.d(219,25): Error: undefined identifier 'HBITMAP'
dmd failed with exit code 1.

Compiling on 2068 / 2068.1

Compiling on Ubuntu 15.04, dmd crashes with the following.

~/workspace/DMagick$ make
dmd -O -m64 -version=MagickCore_692 -c dmagick/Array.d -ofdmagick/Array.o
dmd -O -m64 -version=MagickCore_692 -c dmagick/CoderInfo.d -ofdmagick/CoderInfo.o
dmd -O -m64 -version=MagickCore_692 -c dmagick/Color.d -ofdmagick/Color.o
dmagick/Color.d(122): Error: std.math.rndtol called with argument types (const(ushort)) matches         both:
/usr/include/dmd/phobos/std/math.d(1461):     std.math.rndtol(real x)
and:
/usr/include/dmd/phobos/std/math.d(1467):     std.math.rndtol(float x)

Tag v0.2.3

Please would you tag a version 0.2.3, incorporating the import path fix (a45741c) so that it can be referenced in DUB without using the (now deprecated) git branch dependency specifier?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.