ROMs y desarrollo HTC Tattoo ROMs y desarrollo HTC Tattoo

Respuesta
 
Herramientas
  #181  
Viejo 01/02/11, 01:01:38
Array

[xs_avatar]
Agedjus Agedjus no está en línea
Usuario muy activo
· Votos compra/venta: (1)
 
Fecha de registro: abr 2010
Localización: Málaga
Mensajes: 778
Modelo de smartphone: Xiaomi M2
Tu operador: Jazztel
Can you create an application that convert .raw (YCrCb) to .jpg?
Responder Con Cita


  #182  
Viejo 01/02/11, 01:07:06
Array

[xs_avatar]
NewZa NewZa no está en línea
Miembro del foro
· Votos compra/venta: (2)
 
Fecha de registro: jul 2008
Localización: Chiclana
Mensajes: 76
Modelo de smartphone: Samsung Galaxy S3
Tu operador: Vodafone
 Cita: Originalmente Escrito por filipeferraz Ver Mensaje
Good news for everyone. I create an Application for android that convert de raw file do JPEG file. Very simple work. Kalim can add the commands to api to direct save images in JPEG format.
Great work!!.
Responder Con Cita
  #183  
Viejo 01/02/11, 01:07:44
Array

[xs_avatar]
filipeferraz filipeferraz no está en línea
Usuario novato en la web
 
Fecha de registro: ene 2011
Mensajes: 18
Modelo de smartphone: HTC Tattoo
Tu operador: Movistar
I tested in my Tattoo with Kalin 10.7 and works. For who wanna test the image needs to be changed to imagem.raw and the app will generate the imagem.jpg. Works only for 3MB quality images. (it's easy to adapt to other resolutions for Kalin).
http://www.megaupload.com/?d=2D2FRUWA
Link for download of apk to install on phone.
The code is very simple, for who want to change and make it better there is the main:
RawToJpeg.java
Código:
package com.image.rawtojpeg;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.graphics.ImageFormat;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.os.Bundle;
import android.widget.TextView;

public class RawToJpeg extends Activity {
    /** Called when the activity is first created. */

    @override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        TextView tv = new TextView(this);
        try {
            FileOutputStream arqSaida = new FileOutputStream("/sdcard/DCIM/Camera/Imagem.jpg");
            File f=new File("/sdcard/DCIM/Camera/Imagem.raw");
            byte[] data = getBytesFromFile(f);
            YuvImage imagemYuv = new YuvImage(data, ImageFormat.NV21, 2048, 1536, null);
            Rect rect = new Rect(0,0,2048,1536);
            imagemYuv.compressToJpeg(rect, 100, arqSaida);
            arqSaida.close();
            tv.setText("Sucesso.");
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            tv.setText("Erro.");
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            tv.setText("Erro2.");
            e.printStackTrace();
        }
        
        setContentView(tv);
    }
    
    public byte[] getBytesFromFile(File file) throws IOException {
        InputStream is = new FileInputStream(file);
        byte[] bytes;
            
        try {
            // Get the size of the file
            long length = file.length();
            
            // You cannot create an array using a long type.
            // It needs to be an int type.
            // Before converting to an int type, check
            // to ensure that file is not larger than Integer.MAX_VALUE.
            if (length > Integer.MAX_VALUE) {
                // File is too large (>2GB)
            }
        
            // Create the byte array to hold the data
            bytes = new byte[(int)length];
        
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            }
        
            // Ensure all the bytes have been read in
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file " + file.getName());
            }
        }
        finally {
            // Close the input stream and return bytes
            is.close();
        }
        return bytes;
    }

}
Responder Con Cita
  #184  
Viejo 01/02/11, 01:12:43
Array

[xs_avatar]
Agedjus Agedjus no está en línea
Usuario muy activo
· Votos compra/venta: (1)
 
Fecha de registro: abr 2010
Localización: Málaga
Mensajes: 778
Modelo de smartphone: Xiaomi M2
Tu operador: Jazztel
 Cita: Originalmente Escrito por filipeferraz Ver Mensaje
I tested in my Tattoo with Kalin 10.7 and works. For who wanna test the image needs to be changed to imagem.raw and the app will generate the imagem.jpg. Works only for 3MB quality images. (it's easy to adapt to other resolutions for Kalin).
http://www.megaupload.com/?d=2D2FRUWA
Link for download of apk to install on phone.
The code is very simple, for who want to change and make it better there is the main:
RawToJpeg.java
Código:
package com.image.rawtojpeg;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.graphics.ImageFormat;
import android.graphics.Rect;
import android.graphics.YuvImage;
import android.os.Bundle;
import android.widget.TextView;

public class RawToJpeg extends Activity {
    /** Called when the activity is first created. */

    @override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        TextView tv = new TextView(this);
        try {
            FileOutputStream arqSaida = new FileOutputStream("/sdcard/DCIM/Camera/Imagem.jpg");
            File f=new File("/sdcard/DCIM/Camera/Imagem.raw");
            byte[] data = getBytesFromFile(f);
            YuvImage imagemYuv = new YuvImage(data, ImageFormat.NV21, 2048, 1536, null);
            Rect rect = new Rect(0,0,2048,1536);
            imagemYuv.compressToJpeg(rect, 100, arqSaida);
            arqSaida.close();
            tv.setText("Sucesso.");
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            tv.setText("Erro.");
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            tv.setText("Erro2.");
            e.printStackTrace();
        }
        
        setContentView(tv);
    }
    
    public byte[] getBytesFromFile(File file) throws IOException {
        InputStream is = new FileInputStream(file);
        byte[] bytes;
            
        try {
            // Get the size of the file
            long length = file.length();
            
            // You cannot create an array using a long type.
            // It needs to be an int type.
            // Before converting to an int type, check
            // to ensure that file is not larger than Integer.MAX_VALUE.
            if (length > Integer.MAX_VALUE) {
                // File is too large (>2GB)
            }
        
            // Create the byte array to hold the data
            bytes = new byte[(int)length];
        
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            }
        
            // Ensure all the bytes have been read in
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file " + file.getName());
            }
        }
        finally {
            // Close the input stream and return bytes
            is.close();
        }
        return bytes;
    }

}
If run... ¿do you know that I love you? XDDDDDD

I will go to try tomorrow, good work

Última edición por Agedjus Día 01/02/11 a las 01:16:10.
Responder Con Cita
  #185  
Viejo 01/02/11, 01:22:40
Array

[xs_avatar]
NewZa NewZa no está en línea
Miembro del foro
· Votos compra/venta: (2)
 
Fecha de registro: jul 2008
Localización: Chiclana
Mensajes: 76
Modelo de smartphone: Samsung Galaxy S3
Tu operador: Vodafone
I have tested it and works!!
Gallery app don't show the image but file explorer does.

EDIT: Before connect usb drive to pc and disconnect, the gallery works full.

Última edición por NewZa Día 01/02/11 a las 01:28:43.
Responder Con Cita
  #186  
Viejo 01/02/11, 01:27:06
Array

[xs_avatar]
filipeferraz filipeferraz no está en línea
Usuario novato en la web
 
Fecha de registro: ene 2011
Mensajes: 18
Modelo de smartphone: HTC Tattoo
Tu operador: Movistar
 Cita: Originalmente Escrito por NewZa Ver Mensaje
I have tested it and works!!
Gallery app don't show the image but file explorer does.
I think that the Folder is not in the path of the Gallery app for images.
Now is just wait Kalin for add the code to camera driver to get a direct jpeg file.
The process and app is very simple. The biggest work is done by Kalin getting the image from camera and the best Rom for Tattoo. Always thanks for Kalin's job.
Responder Con Cita
  #187  
Viejo 01/02/11, 01:29:07
Array

[xs_avatar]
Agedjus Agedjus no está en línea
Usuario muy activo
· Votos compra/venta: (1)
 
Fecha de registro: abr 2010
Localización: Málaga
Mensajes: 778
Modelo de smartphone: Xiaomi M2
Tu operador: Jazztel
JODER

Great work @filipeferraz, ¿where were you all this time? XDDD

P.D: Compis, ya tenemos photo en la tattoo sin pasar por el pc :OOO
P.D2: Esperando a que Kalim meta ese código para tener gran ROM juasjuas
Responder Con Cita
  #188  
Viejo 01/02/11, 02:05:40
Array

[xs_avatar]
newstyle newstyle no está en línea
Usuario muy activo
· Votos compra/venta: (2)
 
Fecha de registro: ene 2010
Localización: Barcelona
Mensajes: 3,527
Modelo de smartphone: G3 - Nexus 5 - SGS II - Desire - Tattoo
Tu operador: Pepephone
 Cita: Originalmente Escrito por Agedjus Ver Mensaje
P.D: Compis, ya tenemos photo en la tattoo sin pasar por el pc :OOO
P.D2: Esperando a que Kalim meta ese código para tener gran ROM juasjuas

por lo que veo ya esta todo casi listo. que grande este hombre

kalim esperamos noticias tuyas!!
Responder Con Cita
  #189  
Viejo 01/02/11, 10:41:50
Array

[xs_avatar]
KalimochoAz KalimochoAz no está en línea
Cocinero veterano
 
Fecha de registro: jun 2008
Localización: Barcelona
Mensajes: 1,092
Modelo de smartphone: HTC Tatoo
Tu operador: Movistar
 Cita: Originalmente Escrito por newstyle Ver Mensaje
por lo que veo ya esta todo casi listo. que grande este hombre

kalim esperamos noticias tuyas!!

Que yo no he hecho nada, solo soy un mandao vuestro!!!

Fijaos, yo puse mi ROM, añadí cuatro cosillas, uno de vosotros vió que salía la foto, puse cuatro cosillas, otro vió que era un raw y que hacia falta que modificara algo más, hice cuatro cosillas, y esa misma persona descubrió que el raw ya estaba completo, hice cuatro cosillas y podíamos hacer tantos raw como queríamos, ya ahora otro usuario se oferce a ayudarme con el código y solo tengo que compilar.

Por cierto @filipeferraz ya ha creado el código, así que atentos que compilo y verificáis el resultado. filipeferraz Has already coded the new rutine, in minutes I will publish KalimGinger.10.10.

Gracias a todos vosotros maestros.
__________________
__________________________________________________ __
CyanogenMod Nexus Devices

Última edición por KalimochoAz Día 01/02/11 a las 10:48:18.
Responder Con Cita
  #190  
Viejo 01/02/11, 11:15:58
Array

[xs_avatar]
ac6729 ac6729 no está en línea
Usuario novato en la web
 
Fecha de registro: jun 2009
Mensajes: 9

Wow...

y yo aún con la rom que viene con Vodafone... me tocará ponerme al día...

Ánimo chicos! el siguiente paso será la radio? o al final quedó por imposible? bueno no pregunto más voy a leer por el foro a ver si saco algo en claro

Lo dicho un excelente trabajo!

ac6729
Responder Con Cita
  #191  
Viejo 01/02/11, 11:28:03
Array

[xs_avatar]
Makarboy Makarboy no está en línea
Miembro del foro
 
Fecha de registro: may 2010
Localización: Linares
Mensajes: 443
Modelo de smartphone: Xiaomi Redmi 4 Pro
Tu operador: Jazztel
 Cita: Originalmente Escrito por ac6729 Ver Mensaje
Wow...

y yo aún con la rom que viene con Vodafone... me tocará ponerme al día...

Ánimo chicos! el siguiente paso será la radio? o al final quedó por imposible? bueno no pregunto más voy a leer por el foro a ver si saco algo en claro

Lo dicho un excelente trabajo!

ac6729
Supongo que lo próximo será ver donde apunta la cámara para que programas tipo de código de barras funcionen o también la cámara de vídeo

Sent from my HTC tattoo using Tapatalk
Responder Con Cita
  #192  
Viejo 01/02/11, 12:16:27
Array

[xs_avatar]
KalimochoAz KalimochoAz no está en línea
Cocinero veterano
 
Fecha de registro: jun 2008
Localización: Barcelona
Mensajes: 1,092
Modelo de smartphone: HTC Tatoo
Tu operador: Movistar
 Cita: Originalmente Escrito por Makarboy Ver Mensaje
Supongo que lo próximo será ver donde apunta la cámara para que programas tipo de código de barras funcionen o también la cámara de vídeo

Sent from my HTC tattoo using Tapatalk
No, antes tengo que hacer la conversion a jpeg en memeria directamente desde el c de libcamera. Esto es solo un parche pero no servirá para las aplicaciones privativas que usan la cámara como la del barcodereader.

Tiempo al tiempo
__________________
__________________________________________________ __
CyanogenMod Nexus Devices
Responder Con Cita
Gracias de parte de:
Respuesta

Estás aquí
Regresar   Portal | Indice > Otras marcas y modelos de smartphones de venta en España > HTC > Otros modelos antiguos de HTC > HTC Tattoo > ROMs y desarrollo HTC Tattoo



Hora actual: 16:19:58 (GMT +2)



User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.

Contactar por correo / Contact by mail / 邮件联系 /