Skip to content
Merged
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
14 changes: 9 additions & 5 deletions examples/js/loaders/EXRLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ THREE.EXRLoader.prototype._parser = function ( buffer ) {

} else if ( type == 'chromaticities' ) {

return parseChromaticities( buffer, offset );
return parseChromaticities( dataView, offset );

} else if ( type == 'compression' ) {

Expand All @@ -839,6 +839,10 @@ THREE.EXRLoader.prototype._parser = function ( buffer ) {

return parseV2f( dataView, offset );

} else if ( type == 'int' ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use the strict comparison operator (===) in EXRLoader? That would be great for code style 😇

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll clean it up 👌


return parseUint32( dataView, offset );

} else {

throw 'Cannot parse value for unsupported type: ' + type;
Expand Down Expand Up @@ -916,8 +920,8 @@ THREE.EXRLoader.prototype._parser = function ( buffer ) {

for ( var y = 0; y < height; y ++ ) {

var y_scanline = parseUint32( buffer, offset );
var dataSize = parseUint32( buffer, offset );
var y_scanline = parseUint32( bufferDataView, offset );
var dataSize = parseUint32( bufferDataView, offset );

for ( var channelID = 0; channelID < EXRHeader.channels.length; channelID ++ ) {

Expand All @@ -928,9 +932,9 @@ THREE.EXRLoader.prototype._parser = function ( buffer ) {
// HALF
for ( var x = 0; x < width; x ++ ) {

var val = parseFloat16( buffer, offset );
var val = parseFloat16( bufferDataView, offset );

byteArray[ ( ( ( width - y_scanline ) * ( height * numChannels ) ) + ( x * numChannels ) ) + cOff ] = val;
byteArray[ ( ( (height - y_scanline) * ( width * numChannels ) ) + ( x * numChannels ) ) + cOff ] = val;

}

Expand Down