Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image.getExtension() doesn't work #241

Closed
nfyfamr opened this issue Feb 19, 2017 · 2 comments
Closed

image.getExtension() doesn't work #241

nfyfamr opened this issue Feb 19, 2017 · 2 comments

Comments

@nfyfamr
Copy link

nfyfamr commented Feb 19, 2017

The document(https://github.com/oliver-moran/jimp#writing-to-files) says that use image.getExtension method to get file extension.
So I tried that, but get the error that image.getExtension isn't a function. See the following.

code:

	Jimp.read(imgURL).then( image => {
		console.log( image );
		let folderPath = './2017_01_02'
		let fileName = "origianl." + image.getExtension();
		let path = url.resolve(folderPath, fileName);
		...
	});

and result:

Jimp {
  _originalMime: 'image/jpeg',
  bitmap:
   { width: 1466,
     height: 1201,
     data: <Buffer db dc e4 ff d8 d9 e1 ff cd e2 e7 ff cd e2 e7 ff ca e0 e9 ff cb e1 ea ff ce de ea ff d0 e0 ec ff cc e1 ea ff cc e1 ea ff cc e1 ea ff cc e1 ea ff cf df ... > } }
TypeError: image.getExtension is not a function
    at Jimp.read.then.image (C:\Users\wrl\Desktop\weeklymenu\index.js:29:38)
    at process._tickCallback (internal/process/next_tick.js:103:7)

So, could you check the error and update the docment?

@nfyfamr nfyfamr changed the title image.getExtension() doesn't woring image.getExtension() doesn't work Mar 17, 2017
@thewizarodofoz
Copy link
Contributor

thewizarodofoz commented Apr 25, 2017

I believe this is the same issue as #237 and #250.

I verified this by replacing the content of index.js in my node_modules folder with the file from this repository, and it worked.

@iwsfg
Copy link
Contributor

iwsfg commented May 27, 2017

Never version was pusblished to NPM a week ago, this problem is now resolved.
Closing the issue

@iwsfg iwsfg closed this as completed May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants