-
Notifications
You must be signed in to change notification settings - Fork 250
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
added image processing extras #91
Conversation
I'm a bit torn, because while it's faster to make the image processing an optional step, it makes the code a bit more confusing. It would be kind of nice if image processing was completely hidden from An alternative is to continue to allow Let me know what you think, or if I'm overlooking something. |
Can't this be handled with each stage declaring its dependencies? See #75. |
I really like option 2 for re-encoding. I also toyed with the idea of On Thursday, June 16, 2016, Sean Lilley [email protected] wrote:
|
…f images have been changed before encoding
Updated! As discussed offline, we decided to keep the I also updated |
merged in master. |
var Jimp = require('jimp'); | ||
|
||
module.exports = encodeImages; | ||
var async = require('async'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the ordering here.
Updated! |
@pjcozzi integrating image processing into I imagine we could add something before runStages that checks if the pipeline needs image processing extras, but as @lilleyse pointed out offline that could get messy if we have to add anything else that wraps the pipeline like this. |
@@ -5,6 +5,7 @@ var readGltf = require('../../lib/readGltf'); | |||
var readAccessor = require('../../lib/readAccessor'); | |||
var writeAccessor = require('../../lib/writeAccessor'); | |||
|
|||
var basePath = './specs/data/boxTexturedUnoptimized/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few lines like this that aren't used. Otherwise this PR looks ready to me.
ok. Updated! |
We should adopt a promise style architecture for both synchronous and asynchronous stages; it would allow all stages to be run in the same fashion. |
Yes, please add it to #1. |
callback(gltfWithExtras); | ||
if (options.imageProcess) { | ||
encodeImages(gltfWithExtras, callback); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else {
In anticipation of ambient occlusion and other future image processing stages, I added extras for use with jimp (https://www.npmjs.com/package/jimp) in the form of a gltf-level scratch
Jimp
image andJimp
copies of all the existing images, stored asjimpImage
inextras._pipeline.
Since this won't be used for every pipeline configuration, I tried to make it as optional as possible.
I also added relevant specs.