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

Exports should be type object not function and module.exports needs to be defined at the bottom #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
This is a fork of https://github.com/notmasteryet/jpgjs
This fork fixes issue #43, modules.export is now correctly defined.

Simple JPEG/DCT data decoder in JavaScript. Also this project includes JPEG 2000 and JBIG2 decoders.

Example URL:
Expand Down
22 changes: 12 additions & 10 deletions jpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,6 @@ var JpegImage = function jpegImage() {
return JpegImage;
}();

if (typeof exports === "function") {
module.exports = {
JpegImage: JpegImage,
JpegDecoder: JpegDecoder,
JpxDecoder: JpxDecoder,
Jbig2Decoder: Jbig2Decoder
};
}

var PDFJS;

(function(PDFJS) {
Expand Down Expand Up @@ -4277,4 +4268,15 @@ var JpegDecoder = PDFJS.JpegImage;

var JpxDecoder = PDFJS.JpxImage;

var Jbig2Decoder = PDFJS.Jbig2Image;
var Jbig2Decoder = PDFJS.Jbig2Image;


if(typeof exports === "object")
{
module.exports = {
JpegImage: JpegImage,
JpegDecoder: JpegDecoder,
JpxDecoder: JpxDecoder,
Jbig2Decoder: Jbig2Decoder
};
}