Comments (5)
I usually get that error from STBI when I supply the wrong path. Are you sure you can open the file?
discard readFile("C:\\Nim\\NimExamples\\MyRecipes\\a.png")
work?
Are you sure its a png file? STBI can't open some png files what are odd like monochrome ...
Does it work with png files in the test folder?
from flippy.
The same exception accurred on Windows 10 (64):
Nim Compiler Version 1.0.4 [Windows: i386]
MinGW32 from Nim official site
Tested with fillCirle.png in the test folder and made sure the path was correct by:
doAssert img.fileExists
May be a link issue:
https://gitlab.com/define-private-public/stb_image-Nim/issues/8
from flippy.
This issue can be solved by adding cdecl
to stb_... procs:
# Internal functions
proc stbi_write_png(
filename: cstring;
w, h, comp: cint;
data: pointer,
stride_in_bytes: int
): cint
{.importc: "stbi_write_png",cdecl.}
As jangko said on Nim forum:
depends on your C compiler configuration, most of the times you need to specify the calling convention explicitly, for example: stdcall for msvc or cdecl for gcc
in your case, try add cdecl:
proc addTwoIntegers(a, b: cint): cint {.importc,cdecl.}
from flippy.
I switched to using https://github.com/jangko/nimPNG which has no C code.
Does this work for you now?
from flippy.
The nimPNG based version of flippy works for me and now it supports Unicode file names on Windows(Using MinGW)
from flippy.
Related Issues (17)
- Float precision ? HOT 1
- unable to rotate image? HOT 8
- Resizing Images using -d:useStl giving strange results HOT 2
- Incorrect color after minifying image HOT 2
- Flippy is not loading an image HOT 7
- Loops in flippy access memory discontinuously HOT 2
- Artifacts introduced when rendering subpixels HOT 2
- Can pictures be saved as memory files? HOT 2
- Getting an error when running the basic usage example: Error: undeclared identifier: 'rgba' HOT 2
- The 'image.save()' method can only be saved on a local disk. Can it be saved in memory? HOT 1
- Error: undeclared identifier: 'Rect' HOT 1
- Unnecessary param in computeBounds HOT 1
- flippy.nim(1, 22) Error: cannot open file: chroma/blends HOT 2
- Unable to build/install other libraries (e.g. NSU) that depends on flippy HOT 1
- does not support Unicode filenames on Windows HOT 3
- image.putRgba issue or user error ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flippy.