Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/randytarampi/pseudoimage
ʕつ◕ᴥ◕ʔつ 📷 → Your application's pseudolocales' image folders
https://github.com/randytarampi/pseudoimage
application-pseudolocales assets generator i18n images internationalization l10n localization node p7e pseudolocalization
Last synced: 24 days ago
JSON representation
ʕつ◕ᴥ◕ʔつ 📷 → Your application's pseudolocales' image folders
- Host: GitHub
- URL: https://github.com/randytarampi/pseudoimage
- Owner: randytarampi
- License: mit
- Created: 2016-07-03T21:57:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-12T18:33:10.000Z (about 3 years ago)
- Last Synced: 2024-12-01T21:48:01.579Z (about 2 months ago)
- Topics: application-pseudolocales, assets, generator, i18n, images, internationalization, l10n, localization, node, p7e, pseudolocalization
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@randy.tarampi/pseudoimage
- Size: 13.6 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ʕつ◕ᴥ◕ʔつ 📷 → Your application's pseudolocales' image folders
[![npm versions](https://img.shields.io/npm/v/@randy.tarampi/pseudoimage.svg?style=flat-square)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
[![npm downloads](https://img.shields.io/npm/dt/@randy.tarampi/pseudoimage.svg?style=flat-square)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
[![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/@randy.tarampi/pseudoimage.svg?style=flat-square)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/@randy.tarampi/pseudoimage.svg?style=flat-square)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
[![npm license](https://img.shields.io/npm/l/@randy.tarampi/pseudoimage.svg?registry_uri=https%3A%2F%2Fregistry.npmjs.com&style=flat-square)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
[![Build status](https://img.shields.io/travis/com/randytarampi/pseudoimage.svg?style=flat-square)](https://travis-ci.com/randytarampi/pseudoimage)
[![Build status](https://ci.appveyor.com/api/projects/status/9torglvwe5nnn2of/branch/master?svg=true&style=flat-square)](https://ci.appveyor.com/project/randytarampi/lwip/branch/master)
[![Coverage status](https://img.shields.io/coveralls/randytarampi/pseudoimage.svg?style=flat-square)](https://coveralls.io/github/randytarampi/pseudoimage?branch=master)
[![Maintainability status](https://img.shields.io/codeclimate/maintainability-percentage/randytarampi/pseudoimage.svg?style=flat-square)](https://codeclimate.com/github/randytarampi/pseudoimage/maintainability)
[![Analytics](https://ga-beacon.appspot.com/UA-50921068-1/beacon/github/randytarampi/me/tree/master/packages/pseudoimage?flat&useReferrer)](https://github.com/igrigorik/ga-beacon)[![Install @randy.tarampi/pseudoimage](https://nodeico.herokuapp.com/@randy.tarampi/pseudoimage.svg)](https://www.npmjs.com/package/@randy.tarampi/pseudoimage)
This uses [@randy.tarampi/lwip](https://github.com/randytarampi/lwip) to modify your images to create a fake, which gets saved somewhere.
## Usage
```javascript
let Pseudoimage = require("@randy.tarampi/pseudoimage");
let sourceDirectory = "/Users/randy.tarampi/Desktop/images";
let destinationDirectory = "/Users/randy.tarampi/Desktop/fakeImages";
let expect = require("chai").expect;let pseudoimage = new Pseudoimage(sourceDirectory, destinationDirectory);
pseudoimage.generatePseudoImages();// There should be a copy for each supported image in `sourceDirectory` in `destinationDirectory`
let files = fs.readdirSync(sourceDirectory);
files.map((file) => {
openImage(file)
.then((image) => {
expect(images[0].width()).to.eql(images[1].width());
expect(images[0].height()).to.eql(images[1].height());
})
.catch((error) => {
console.error(error); // Shouldn't see any errors
});
});function openImage(imagePath) {
return new Promise((resolve, reject) => {
pseudoimage.open(imagePath, (error, image) => {
if (error) {
reject(error);
return;
}
resolve(image);
})
});
}
```