https://github.com/fyvfyv/reset-image-orientation
Reset uploaded image orientation based on EXIF
https://github.com/fyvfyv/reset-image-orientation
base64 browser exif image image-manipulation img orientation reset
Last synced: 3 months ago
JSON representation
Reset uploaded image orientation based on EXIF
- Host: GitHub
- URL: https://github.com/fyvfyv/reset-image-orientation
- Owner: fyvfyv
- License: mit
- Created: 2019-01-12T14:20:32.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T19:00:06.000Z (over 1 year ago)
- Last Synced: 2025-04-01T16:17:03.397Z (about 1 year ago)
- Topics: base64, browser, exif, image, image-manipulation, img, orientation, reset
- Language: TypeScript
- Size: 94.7 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reset-image-orientation
Reset uploaded image orientation based on EXIF
## Installation
```sh
npm install reset-image-orientation
```
## Javascript example
```javascript
var resetOrientation = require('reset-image-orientation');
var input = document.querySelector('input[type="file"]');
var img = document.querySelector('img');
input.addEventListener('change', function(e) {
e.preventDefault();
var file = e.target.files[0];
resetOrientation.default()(file, function(base64) => {
img.src = base64;
});
});
```
## Typescript example
```typescript
import resetOrientation from 'reset-image-orientation';
const input = document.querySelector('input[type="file"]');
const img = document.querySelector('img');
input.addEventListener('change', function(e: Event) {
e.preventDefault();
var file = e.target.files[0];
resetOrientation(file, function(base64: string) => {
img.src = base64;
});
});
```
## License
[MIT](LICENSE)