티스토리 툴바


크리에이티브 커먼즈 라이선스
Creative Commons License

vi /etc/selinux/config

SELINUX=disabled

yum install mod_ssl 하여 mod_ssl을 인스톨한다.

openssl 도 인스톨되어 있는지 확인하고 없으면 인스톨한다.

공개키, 개인키, 싸인을 생성한다.

# Generate private key 
openssl genrsa -out ca.key 1024 # Generate CSR openssl req -new -key ca.key -out ca.csr # Generate Self Signed Key openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt


생성된 키파일들을 지정된 위치에 옮긴다. # Move the files to the correct locations mv ca.crt /etc/pki/tls/certs mv ca.key /etc/pki/tls/private/ca.key mv ca.csr /etc/pki/tls/private/ca.csr


vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf 한 후에,

SSLCertificateFile 항목과 SSLCertificateKeyFile항목을 아래와 같이 설정한다.

SSLCertificateKeyFile /etc/pki/tls/private/ca.key


SSLCertificateFile /etc/pki/tls/certs/ca.crt


httpd 서비스를 새로 시작한다.

/etc/init.d/httpd restart 
저작자 표시
Posted by 우와신난다 트랙백 0 : 댓글 1
크리에이티브 커먼즈 라이선스
Creative Commons License

일반 안드로이드에 내장된 프로그램으로 Intent 호출하여 찍는다면 orientation 정보가 추가되어있어 그것만 보고 돌리면 된다만
surface로 직접 만들어 찍으면 정보가 없다. 그럴땐 저장할 때 돌려주자 아래 처럼 2.2 이상에서 잘된다. 그 이하는 책임 못짐


PictureCallback jpegCallback = new PictureCallback() {
  
public void onPictureTaken(byte[] data, Camera camera) {
     
FileOutputStream outStream = null;
     
try {
        imageFilePath
= getFilename();
       
InputStream is = new ByteArrayInputStream(data);
       
Bitmap bmp = BitmapFactory.decodeStream(is);
       
// Getting width & height of the given image.
       
if (bmp != null){
          
int w = bmp.getWidth();
          
int h = bmp.getHeight();
          
// Setting post rotate to 90
          
Matrix mtx = new Matrix();
           mtx
.postRotate(90);
          
// Rotating Bitmap
          
Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);
          
ByteArrayOutputStream stream = new ByteArrayOutputStream();
           rotatedBMP
.compress(Bitmap.CompressFormat.PNG, 100, stream);
          
byte[] byteArray = stream.toByteArray();
           outStream
= new FileOutputStream
                             
(String.format(imageFilePath,System.currentTimeMillis()));
           outStream
.write(byteArray);
           outStream
.close();
       
} else {
           outStream
= new FileOutputStream
                             
(String.format(imageFilePath,System.currentTimeMillis()));
           outStream
.write(data);
           outStream
.close();          
       
}      

        preview
.camera.startPreview();
   
} catch (FileNotFoundException e) {
        e
.printStackTrace();
   
} catch (IOException e) {
        e
.printStackTrace();
   
} finally {
   
}
 
}
};
저작자 표시
Posted by 우와신난다 트랙백 0 : 댓글 0

Android Camera Release()

2013/04/19 10:39 from 분류없음
크리에이티브 커먼즈 라이선스
Creative Commons License

method called after release() exception unable to resume with android camera


Holder에 callback을 지워주면 깔끔하게 종료된다.

@Override public void surfaceDestroyed(SurfaceHolder surfaceHolder) {

    this.getHolder().removeCallback(this);
    mCamera.stopPreview();
    mCamera.release();
    mCamera = null;
  
 
}
 
요런식이라던가
 
surface 밖에서는
public void onPause() {
    super.onPause();

    if (mCamera != null) {
        mCamera.setPreviewCallback(null);
        mPreview.getHolder().removeCallback(mPreview);
        mCamera.release();
    
}
요런식으로 여기서 mPreview는 camera surface preview 
 

저작자 표시
Posted by 우와신난다 트랙백 0 : 댓글 0