Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@internetarchive/bookreader

Package Overview
Dependencies
Maintainers
18
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetarchive/bookreader - npm Package Compare versions

Comparing version 5.0.0-68 to 5.0.0-69

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# 5.0.0-69
- Fix: Handle ppi incorrectly set to one @cdrini
# 5.0.0-68

@@ -2,0 +5,0 @@ - Fix: 1up zoom wrong on start/entering full screen @cdrini

2

package.json
{
"name": "@internetarchive/bookreader",
"version": "5.0.0-68",
"version": "5.0.0-69",
"description": "The Internet Archive BookReader.",

@@ -5,0 +5,0 @@ "repository": {

@@ -355,4 +355,5 @@ // @ts-check

constructor(book, index) {
// TODO: Get default from config
this.ppi = book._getDataProp(index, 'ppi', book.ppi);
// Values less than 10 cause the UI to not work correctly
const pagePPI = book._getDataProp(index, 'ppi', book.ppi);
this.ppi = Math.max(pagePPI < 10 ? book.ppi : pagePPI, 10);
this.book = book;

@@ -359,0 +360,0 @@ this.index = index;

@@ -27,4 +27,4 @@ import sinon from 'sinon';

test('handles single page data', () => {
const bm = new BookModel({ data: SAMPLE_DATA.slice(0, 1), options: {ppi: 1} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 123, height: 123 });
const bm = new BookModel({ data: SAMPLE_DATA.slice(0, 1), options: {ppi: 10} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 12.3, height: 12.3 });
});

@@ -43,4 +43,4 @@

Object.assign(data[1][1], sizes[2]);
const bm = new BookModel({ data, options: {ppi: 1} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 200, height: 2200 });
const bm = new BookModel({ data, options: {ppi: 10} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 20, height: 220 });
});

@@ -61,4 +61,4 @@

Object.assign(data[2][0], sizes[3]);
const bm = new BookModel({ data, options: {ppi: 1} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 300, height: 2300 });
const bm = new BookModel({ data, options: {ppi: 10} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 30, height: 230 });
});

@@ -77,4 +77,4 @@

Object.assign(data[1][1], sizes[2]);
const bm = new BookModel({ data, options: {ppi: 1} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 30, height: 30 });
const bm = new BookModel({ data, options: {ppi: 10} });
expect(bm.getMedianPageSizeInches()).toEqual({ width: 3, height: 3 });
});

@@ -81,0 +81,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc