Skip to content

Adding new feature - advanced screen comparison. #269

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

Closed
wants to merge 1 commit into from

Conversation

aux-lux
Copy link

@aux-lux aux-lux commented Jun 29, 2018

Description

Script is doing selective comparison of two images to provide precise comparison.

Motivation and Context

It's way better then recent, obviously.


I hereby agree to the terms of the AET Contributor License Agreement.

Copy link

@zofoklecja zofoklecja left a comment

Choose a reason for hiding this comment

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

There is a lot of readability issues in this code (apart from the file being pretty long)

var simplifiedList = [];
var previousLine;

for (var y = 0; y < data.length / imageWidth / 4; y ++) {

Choose a reason for hiding this comment

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

I think data.length / (imageWidth * 4) would look clearer

Also - why 4? Magic variable? ✨
I can see it being used throughout the function. Consider putting it in var with descriptive name.

Copy link
Author

Choose a reason for hiding this comment

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

It's because of way data from image is provided. It reads all pixels and merges it into single array:
[r0,g0,b0,a0,r1,g1,b1,a1,...] r0 = red value from first pixel, r1 = red value from second pixel etc.
It can be named tho. I'll do it.

@@ -0,0 +1,698 @@
window.initNewComparison = function (window, document, undefined) { return function(event) {

Choose a reason for hiding this comment

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

Indents seem to be all over the place in this file. Please fix them for readability.

}
}

function convertDifferenceData(data1, data2) {

Choose a reason for hiding this comment

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

Numbers in variable names usually make for unreadable code.

return color;
}

function processLines() {

Choose a reason for hiding this comment

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

This is one monster of a function. Any way to split it into more readable chunks or simplify the logic you use?

Copy link
Author

Choose a reason for hiding this comment

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

Can be tricky :) I'll try ;)

Copy link
Contributor

@malaskowski malaskowski left a comment

Choose a reason for hiding this comment

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

@aux-lux This is great looking and very promising feature for screenshots comparison. Thank you very much for your contribution.
However, there is still some work to adjust it to the current implementation standards in AET report.
Could you please start with formatting the code according to the coding conventions?
The next step would be splitting newComparison.js into smaller modules that would have singular responsibility. AET reports are designed using Angular, it would be great to adjust this feature into the codebase following John Papa's best practices.

@malaskowski malaskowski added the help wanted Hey, contributor! We need your help. label Jul 5, 2018
@malaskowski
Copy link
Contributor

malaskowski commented Aug 29, 2018

All fixes done in #297 , thank you @aux-lux and @m-suchorski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Hey, contributor! We need your help.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants