Skip to content
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

Scraping Apple device specs is broken In version 3.1.3 #362

Closed
maklai-0x001 opened this issue Jul 31, 2020 · 2 comments
Closed

Scraping Apple device specs is broken In version 3.1.3 #362

maklai-0x001 opened this issue Jul 31, 2020 · 2 comments
Labels
bug Something isn't working needs verification Bug needs to be verified with reproduction

Comments

@maklai-0x001
Copy link

maklai-0x001 commented Jul 31, 2020

Before update to 3.1.3 with -s command i was able to generate all needed splashes now new version even with -s false skips following :
apple-splash-0-0.png
apple-splash-320-568.png
apple-splash-375-667.png
apple-splash-375-812.png
apple-splash-414-736.png
apple-splash-414-896.png
apple-splash-768-1024.png
apple-splash-810-1080.png
apple-splash-834-1112.png
apple-splash-834-1194.png
apple-splash-1024-1366.png
apple-splash-1242-2208.png

  1. Execute cli command 'npx pwa-asset-generator ./logo.svg ./img/icons -p "5%" -b "linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)" --type png --quality 100 --path-override "/img/icons"'
    1.1 Execute cli command 'npx pwa-asset-generator ./logo.svg ./img/icons -p "5%" -b "linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)" --type png --quality 100 --path-override "/img/icons" -s false '
  • OS: [macOS ]
  • npm version [ 6.14.7]
  • cli version [3.1.3]
@maklai-0x001 maklai-0x001 added bug Something isn't working needs verification Bug needs to be verified with reproduction labels Jul 31, 2020
@maklai-0x001
Copy link
Author

Small Debug tip:
Returned back to v 3.1.1 Running commands :
npx pwa-asset-generator ./logo.svg ./img/icons -p "5%" -b "linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)" --type png --quality 100 --path-override "/img/icons"
Generates:
apple-icon-120
apple-icon-167
apple-icon-152
apple-icon-180
apple-splash-0-0
apple-splash-320-568
apple-splash-375-667
apple-splash-375-812
apple-splash-414-736
apple-splash-414-896
apple-splash-768-1024
apple-splash-810-1080
apple-splash-834-1112
apple-splash-834-1194
apple-splash-1024-1366
manifest-icon-192
manifest-icon-512

npx pwa-asset-generator ./logo.svg ./img/icons -p "5%" -b "linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)" --type png --quality 100 --path-override "/img/icons" -s false

**The rest of splashes

@onderceylan
Copy link
Collaborator

Hi @maklai-0x001, you were never supposed to get those images as an output. It was due to a recent change in the source page, which broke the functionality of the lib: https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/

You can tell it by the image name: apple-splash-0-0, this doesn't make any sense.

v3.1.2 fixes that issue by properly scraping the table. After the scraping, this is the source of dimensions for the latest Apple human interface guidelines:

[
  {
    "device": "12.9\" iPad Pro",
    "portrait": {
      "width": 2048,
      "height": 2732
    },
    "landscape": {
      "width": 2732,
      "height": 2048
    },
    "scaleFactor": 2
  },
  {
    "device": "11\" iPad Pro",
    "portrait": {
      "width": 1668,
      "height": 2388
    },
    "landscape": {
      "width": 2388,
      "height": 1668
    },
    "scaleFactor": 2
  },
  {
    "device": "10.5\" iPad Pro",
    "portrait": {
      "width": 1668,
      "height": 2388
    },
    "landscape": {
      "width": 2388,
      "height": 1668
    },
    "scaleFactor": 2
  },
  {
    "device": "9.7\" iPad Pro",
    "portrait": {
      "width": 1536,
      "height": 2048
    },
    "landscape": {
      "width": 2048,
      "height": 1536
    },
    "scaleFactor": 2
  },
  {
    "device": "7.9\" iPad mini",
    "portrait": {
      "width": 1536,
      "height": 2048
    },
    "landscape": {
      "width": 2048,
      "height": 1536
    },
    "scaleFactor": 2
  },
  {
    "device": "10.5\" iPad Air",
    "portrait": {
      "width": 1668,
      "height": 2224
    },
    "landscape": {
      "width": 2224,
      "height": 1668
    },
    "scaleFactor": 2
  },
  {
    "device": "9.7\" iPad Air",
    "portrait": {
      "width": 1536,
      "height": 2048
    },
    "landscape": {
      "width": 2048,
      "height": 1536
    },
    "scaleFactor": 2
  },
  {
    "device": "10.2\" iPad",
    "portrait": {
      "width": 1620,
      "height": 2160
    },
    "landscape": {
      "width": 2160,
      "height": 1620
    },
    "scaleFactor": 2
  },
  {
    "device": "9.7\" iPad",
    "portrait": {
      "width": 1536,
      "height": 2048
    },
    "landscape": {
      "width": 2048,
      "height": 1536
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone 11 Pro Max",
    "portrait": {
      "width": 1242,
      "height": 2688
    },
    "landscape": {
      "width": 2688,
      "height": 1242
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 11 Pro",
    "portrait": {
      "width": 1125,
      "height": 2436
    },
    "landscape": {
      "width": 2436,
      "height": 1125
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 11",
    "portrait": {
      "width": 828,
      "height": 1792
    },
    "landscape": {
      "width": 1792,
      "height": 828
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone XS Max",
    "portrait": {
      "width": 1242,
      "height": 2688
    },
    "landscape": {
      "width": 2688,
      "height": 1242
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone XS",
    "portrait": {
      "width": 1125,
      "height": 2436
    },
    "landscape": {
      "width": 2436,
      "height": 1125
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone XR",
    "portrait": {
      "width": 828,
      "height": 1792
    },
    "landscape": {
      "width": 1792,
      "height": 828
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone X",
    "portrait": {
      "width": 1125,
      "height": 2436
    },
    "landscape": {
      "width": 2436,
      "height": 1125
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 8 Plus",
    "portrait": {
      "width": 1080,
      "height": 1920
    },
    "landscape": {
      "width": 1920,
      "height": 1080
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 8",
    "portrait": {
      "width": 750,
      "height": 1334
    },
    "landscape": {
      "width": 1334,
      "height": 750
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone 7 Plus",
    "portrait": {
      "width": 1080,
      "height": 1920
    },
    "landscape": {
      "width": 1920,
      "height": 1080
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 7",
    "portrait": {
      "width": 750,
      "height": 1334
    },
    "landscape": {
      "width": 1334,
      "height": 750
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone 6s Plus",
    "portrait": {
      "width": 1080,
      "height": 1920
    },
    "landscape": {
      "width": 1920,
      "height": 1080
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 6s",
    "portrait": {
      "width": 750,
      "height": 1334
    },
    "landscape": {
      "width": 1334,
      "height": 750
    },
    "scaleFactor": 2
  },
  {
    "device": "iPhone 6 Plus",
    "portrait": {
      "width": 1080,
      "height": 1920
    },
    "landscape": {
      "width": 1920,
      "height": 1080
    },
    "scaleFactor": 3
  },
  {
    "device": "iPhone 6",
    "portrait": {
      "width": 750,
      "height": 1334
    },
    "landscape": {
      "width": 1334,
      "height": 750
    },
    "scaleFactor": 2
  },
  {
    "device": "4.7\" iPhone SE",
    "portrait": {
      "width": 750,
      "height": 1334
    },
    "landscape": {
      "width": 1334,
      "height": 750
    },
    "scaleFactor": 2
  },
  {
    "device": "4\" iPhone SE",
    "portrait": {
      "width": 640,
      "height": 1136
    },
    "landscape": {
      "width": 1136,
      "height": 640
    },
    "scaleFactor": 2
  }
]

Please use the latest version and it should be good on all listed devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs verification Bug needs to be verified with reproduction
Projects
None yet
Development

No branches or pull requests

2 participants