An open API service indexing awesome lists of open source software.

https://github.com/kooljay82/vue-m-camera

To aviod orientation changes / For mobile web && appication webview
https://github.com/kooljay82/vue-m-camera

Last synced: about 2 months ago
JSON representation

To aviod orientation changes / For mobile web && appication webview

Awesome Lists containing this project

README

          

# vue-m-camera
### (return back to original orientation)

## Purpose

To avoid changing orientation of photo automatically which taken via camera of user's device, you have to use 'exif-js' and 'blueimp-load-image' library.

'exif-js' and 'blueimp-load-image' are very powerful and easy to use. But where developing in vue.js, it might be quite annoying. (Not difficult but need take some time.)

When you are working on some mobile web project (including webview of application), you might have to access camera and photos then you should overcome 'orientation of photo' problem.

So I made it prevent changing orientation automatically in '*.vue' component. (Of course, absolutely, this component using 'exif-js' and 'blueimp-load-image')

This component provides invisible 'input (type=file)' and you can customize it whatever you want.

This component, seems like a 'input (type=file)', has function that pass image file of converted binary data with original orientation.

## Reference

stackoverflow: https://stackoverflow.com/questions/20600800/js-client-side-exif-orientation-rotate-and-mirror-jpeg-images#answer-39384061

(*This answer was very helpful to solve my problem.)

## How to install

```
npm install @kooljay82/vue-m-camera --save
```

## How to import and registry

In your component,

```
import VmcCmpt from "@kooljay82/vue-m-camera"
export default {
components: {
'vmc-cmpt': VmcCmpt
}
}
```
Or in your entry file. (ex: main.js)

```
import Vue from 'vue'
...
import VmcCmpt from "@kooljay82/vue-m-camera"
...
Vue.component("vmc-cmpt", VmcCmpt);

```

## How to use

1. Use 'ul' and 'li' to wrap 'vmc-cmpt' component to use 'hideOrShowBtn' method. **It's essential!**

2. Pass length of array containing images to 'len' for watching changes of array. **It's essential!**

3. Pass maximum length of array containing images to 'max' for hiding 'vmc-cmpt' component. **It's not essential, but recommended.**

4. You could insert slot to 'vmc-cmpt' and could customize button which you inserted. (icons, text, background image etc...)

5. 'imgToData' is custom event that you could handle converted image with this event.

6. Pass 'maxWidth' for image scaling. **It's optional, default is 500.**

```




  • βœ•





  • +




```

6. You can find a sample page at here. [CodeSandbox.io / https://codesandbox.io/embed/vue-template-fpfjj]

## MIT

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

It's MIT license, you can use or modify is free. But please leave comment about original source repository. It would be grateful.

## Korean

μƒμ„Έν•œ μ„€λͺ… λ³΄λ‹€λŠ” CodeSandbox.io의 예제λ₯Ό λ³΄μ‹œλ©΄ μžμ„Ένžˆ μ•Œ 수 μžˆλ„λ‘ 링크λ₯Ό λ‚¨κ²ΌμŠ΅λ‹ˆλ‹€.

κ³ μ³μ•Όν• κ²Œ λ§Žμ§€λ§Œ μ˜€ν”ˆμ†ŒμŠ€λ‘œ λ°œμ „μ‹œν‚€κΈ° μœ„ν•¨ λ³΄λ‹€λŠ” ν•„μš”μ— μ˜ν•œ μ œμž‘μ΄λΌ μ—…λ°μ΄νŠΈλŠ” μ•„μ£Ό λœΈν• κ²ƒ κ°™μŠ΅λ‹ˆλ‹€.

ν…ŒμŠ€νŠΈ μ½”λ“œ, κ΅¬ν˜„λΆ€ 등에 문제점 ν˜Ήμ€ μ•„μ‰¬μš΄ 점이 μžˆλ‹€λ©΄ jinho82@gmail.com으둜 메일 λ³΄λ‚΄μ£Όμ„Έμš”.

κ°μ‚¬ν•©λ‹ˆλ‹€.