Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
hearthstone-card-images
Advanced tools
Readme
Due directly to the decisions and actions of Blizzard Entertainment, Inc., I will no longer be maintaining this project. The community is free to fork and continue it, but I do not wish to be involved.
Hearthstone card images for all locales for use in conjunction with the official Hearthstone API or HearthstoneJSON data.
Try the demo application or see related projects.
All card images and names copyright © Blizzard Entertainment, Inc. Hearthstone® is a registered trademark of Blizzard Entertainment, Inc. Hearthstone Card Images is not affiliated or associated with or endorsed by Hearthstone® or Blizzard Entertainment, Inc.
This method is best if you wish to use git
to stay up-to-date.
Setup: Create a shallow clone of this repo unless you absolutely need the full history. There are a lot of outdated card images that you can avoid altogether if you don't need them.
git clone --depth 1 --branch master --single-branch https://github.com/schmich/hearthstone-card-images
Updating: Update your shallow clone without growing your local git history with the following:
git fetch --depth 1 && git reset --hard origin/master
This method is best if you want fine-grained control over downloading and updating images.
Setup: Download the card images as a .zip or .tar.gz compressed archive from the releases page.
Updating: Use the versioned NPM package to track MD5 hashes of each card image for each locale. The package is updated when cards are added, removed, or updated (see versioning).
The package entrypoint points to manifest/all.json
which, for each locale, maps each card DBF ID to the MD5 hash of its image contents. This hash can be used to determine if your local copy is up-to-date.
Example:
npm install hearthstone-card-images
function* cardImageHashes() {
const manifest = require('hearthstone-card-images');
let base = manifest.config.base;
let version = manifest.config.version;
for (let locale in manifest.cards) {
for (let dbfId in manifest.cards[locale]) {
let url = `${base}/${version}/cards/${locale}/${dbfId}.png`;
let hash = manifest.cards[locale][dbfId];
yield { locale, dbfId, url, hash };
}
}
}
for (let card of cardImageHashes()) {
// Properties:
// card.locale => en_US, pt_BR
// card.dbfId => 64 (Swipe)
// card.url => https://raw.githubusercontent.com/schmich/hearthstone-card-images/5.0.0/cards/en_US/64.png
// card.hash => ef4e301fff3ed65b9c21194e8b22d06c (MD5 hash of image contents)
// Updating:
// 1. Hash local file using MD5, card.locale, and card.dbfId
// 2. Compare local file hash to card.hash
// 3. If missing or different, download card.url locally
}
By default, images are 375x518 PNG format weighing around 100 KB each. A few things can be done to reduce the space and bandwidth needed for storage and transmission:
If you don't need large images, you can resize them using ImageMagick or many other image processing toolkits.
magick convert 64.png -resize 50% out.png
pngquant and pngcrush optimize PNGs by removing extraneous metadata, trying multiple compression methods, and reducing the image's color palette by introducing dithering. Depending on your needs, the quality can be scaled to control the resulting file size.
pngquant 64.png --quality 25 --output out.png
If you don't need transparency, you can convert the images to JPG to save significantly on space. You can also trade off between quality and file size depending on your needs.
magick convert 64.png -background white -flatten -quality 50% out.jpg
The WebP image format has the benefits of JPG compression while also retaining the alpha transparency of PNG. However, this format is not yet supported by all major browsers. WebP has both lossless and lossy modes.
magick convert 64.png -define webp:lossless=true out.webp
magick convert 64.png -quality 75% out.webp
cards
foldercards
folder since Blizzard now gives them a DBF ID when they are revealedThe NPM package adheres to SemVer 2.0.0:
All card images and names copyright © Blizzard Entertainment, Inc. Hearthstone® is a registered trademark of Blizzard Entertainment, Inc. Hearthstone Card Images is not affiliated or associated with or endorsed by Hearthstone® or Blizzard Entertainment, Inc.
All else copyright © 2016 Chris Schmich
MIT License. See LICENSE for details.
FAQs
Hearthstone card images for use with HearthstoneJSON data.
The npm package hearthstone-card-images receives a total of 1 weekly downloads. As such, hearthstone-card-images popularity was classified as not popular.
We found that hearthstone-card-images demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.