mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 09:17:20 +00:00
Adding readme, privacy section, reducing resolution of analytics data.
This commit is contained in:
31
README.md
31
README.md
@@ -1,5 +1,32 @@
|
|||||||
# Squoosh!
|
# Squoosh!
|
||||||
|
|
||||||
Squoosh will be an image compression web app that allows you to dive into the
|
Squoosh is an image compression web app that allows you to dive into the advanced options provided
|
||||||
advanced options provided by various image compressors.
|
by various image compressors.
|
||||||
|
|
||||||
|
# Privacy
|
||||||
|
|
||||||
|
Google analytics is used to record the following:
|
||||||
|
|
||||||
|
* [Basic visit data](https://support.google.com/analytics/answer/6004245?hl=en&ref_topic=2919631).
|
||||||
|
* Before and after image size once an image is downloaded. These values are rounded to the nearest
|
||||||
|
kilobyte.
|
||||||
|
|
||||||
|
Impage compression is handled locally, no additional data is sent to the server.
|
||||||
|
|
||||||
|
# Building locally
|
||||||
|
|
||||||
|
Clone the repo, and:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
You'll get an error on first build because of [a stupid bug we haven't fixed
|
||||||
|
yet](https://github.com/GoogleChromeLabs/squoosh/issues/251).
|
||||||
|
|
||||||
|
You can run the development server with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
|||||||
@@ -129,6 +129,11 @@ export default class Intro extends Component<Props, State> {
|
|||||||
<ul class={style.relatedLinks}>
|
<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/">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/issues">Report a bug</a></li>
|
||||||
|
<li>
|
||||||
|
<a href="https://github.com/GoogleChromeLabs/squoosh/blob/master/README.md#privacy">
|
||||||
|
Privacy
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -60,11 +60,16 @@ export default class Results extends Component<Props, State> {
|
|||||||
|
|
||||||
@bind
|
@bind
|
||||||
onDownload() {
|
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('send', 'event', 'compression', 'download', {
|
||||||
// GA can’t do floats. So we round to ints.
|
metric1: before,
|
||||||
metric1: Math.floor(this.props.source!.file.size),
|
metric2: after,
|
||||||
metric2: Math.floor(this.props.imageFile!.size),
|
metric3: change,
|
||||||
metric3: Math.floor(this.props.imageFile!.size / this.props.source!.file.size * 1000),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user