mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 19:19:47 +00:00
Adding readme, privacy section, reducing resolution of analytics data.
This commit is contained in:
@@ -129,6 +129,11 @@ export default class Intro extends Component<Props, State> {
|
||||
<ul class={style.relatedLinks}>
|
||||
<li><a href="https://github.com/GoogleChromeLabs/squoosh/">View the code</a></li>
|
||||
<li><a href="https://github.com/GoogleChromeLabs/squoosh/issues">Report a bug</a></li>
|
||||
<li>
|
||||
<a href="https://github.com/GoogleChromeLabs/squoosh/blob/master/README.md#privacy">
|
||||
Privacy
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -60,11 +60,16 @@ export default class Results extends Component<Props, State> {
|
||||
|
||||
@bind
|
||||
onDownload() {
|
||||
// GA can’t do floats. So we round to ints. We're deliberately rounding to nearest kilobyte to
|
||||
// avoid cases where exact image sizes leak something interesting about the user.
|
||||
const before = Math.round(this.props.source!.file.size / 1024);
|
||||
const after = Math.round(this.props.imageFile!.size / 1024);
|
||||
const change = Math.round(after / before * 1000);
|
||||
|
||||
ga('send', 'event', 'compression', 'download', {
|
||||
// GA can’t do floats. So we round to ints.
|
||||
metric1: Math.floor(this.props.source!.file.size),
|
||||
metric2: Math.floor(this.props.imageFile!.size),
|
||||
metric3: Math.floor(this.props.imageFile!.size / this.props.source!.file.size * 1000),
|
||||
metric1: before,
|
||||
metric2: after,
|
||||
metric3: change,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user