Java 诺基亚手机上用于拍摄图像的缩略图存储在哪里?

Java 诺基亚手机上用于拍摄图像的缩略图存储在哪里?,java,thumbnails,java-me,nokia,s60,Java,Thumbnails,Java Me,Nokia,S60,以下链接显示了缩略图存储在相应手机中的目录列表: 但是链接上提供的电话是有限的。这是否意味着,对于其他手机(如N86、Expressmusic等),我无法访问缩略图?我尝试使用链接上给出的所有目录结构,但没有一个适用于上述手机。有人知道这件事吗 我不知道这是否是您需要的,但您可以从全尺寸JPEG文件中提取嵌入的缩略图。在我的j2me应用程序中,我这样显示电话库 private final static int STOP_AT_BYTE = 8192; //how far to search

以下链接显示了缩略图存储在相应手机中的目录列表:


但是链接上提供的电话是有限的。这是否意味着,对于其他手机(如N86、Expressmusic等),我无法访问缩略图?我尝试使用链接上给出的所有目录结构,但没有一个适用于上述手机。有人知道这件事吗

我不知道这是否是您需要的,但您可以从全尺寸JPEG文件中提取嵌入的缩略图。在我的j2me应用程序中,我这样显示电话库

private final static int STOP_AT_BYTE = 8192;   //how far to search for thumbnail
private final static int THUMB_MAX_SIZE = 16284; 

private Image getThumbnailFromStream(InputStream str, long fileSize)
{
    byte[] tempByteArray = new byte[THUMB_MAX_SIZE]; // how big can a thumb get.
    byte[] bytefileReader = {0}; // lazy byte reader
    byte firstByte,secondByte = 0;
    int currentIndex = 0;

    int currByte = 0;

    try {
        str.read(bytefileReader);
        firstByte = bytefileReader[0];
        str.read(bytefileReader);
        secondByte = bytefileReader[0];

        currByte += 2;

        if ((firstByte & 0xFF) == 0xFF && (secondByte & 0xFF) == 0xD8) {    //if this is JPEG
            byte rByte = 0;
            do {
                while (rByte != -1 && currByte < fileSize) {
                    str.read(bytefileReader);
                    rByte = bytefileReader[0];
                    currByte++;
                }

                str.read(bytefileReader);
                rByte = bytefileReader[0];
                currByte++;

                if (currByte > STOP_AT_BYTE) {
                    return null;
                }
            } while ((rByte & 0xFF) != 0xD8 && currByte < fileSize); // thumb starts

            if (currByte >= fileSize) {
                return null;
            }

            tempByteArray[currentIndex++] = -1;
            tempByteArray[currentIndex++] = rByte;
            rByte = 0;

            do {
                while (rByte != -1){
                    str.read(bytefileReader);
                    rByte = bytefileReader[0];
                    tempByteArray[currentIndex++] = rByte;
                }

                str.read(bytefileReader);
                rByte = bytefileReader[0];
                tempByteArray[currentIndex++] = rByte;
            } while ((rByte & 0xFF) != 0xD9); // thumb ends

            tempByteArray[currentIndex++] = -1;
            Image image = Image.createImage(tempByteArray, 0, currentIndex-1);
            tempByteArray = null;

            return image;
        }
    } catch (Throwable e) {
        //error
    }

    return null;
}
private final static int STOP在字节=8192处//要搜索多远的缩略图
私有最终静态int THUMB_MAX_SIZE=16284;
私有映像getThumbnailFromStream(InputStream str,长文件大小)
{
byte[]tempByteArray=新字节[THUMB_MAX_SIZE];//拇指能有多大。
byte[]bytefileReader={0};//惰性字节读取器
字节firstByte,secondByte=0;
int currentIndex=0;
int currByte=0;
试一试{
str.read(bytefileReader);
firstByte=bytefileReader[0];
str.read(bytefileReader);
secondByte=bytefileReader[0];
currByte+=2;
if((firstByte&0xFF)==0xFF&&(secondByte&0xFF)==0xD8){//如果这是JPEG
字节rByte=0;
做{
while(rByte!=-1&&currByte在字节处停止){
返回null;
}
}while((rByte&0xFF)!=0xD8&&currByte=文件大小){
返回null;
}
tempByteArray[currentIndex++]=-1;
tempByteArray[currentIndex++]=红细胞;
红细胞=0;
做{
而(红细胞!=-1){
str.read(bytefileReader);
红细胞=bytefileReader[0];
tempByteArray[currentIndex++]=红细胞;
}
str.read(bytefileReader);
红细胞=bytefileReader[0];
tempByteArray[currentIndex++]=红细胞;
}while((rByte&0xFF)!=0xD9);//拇指末端
tempByteArray[currentIndex++]=-1;
Image Image=Image.createImage(tempByteArray,0,currentIndex-1);
tempByteArray=null;
返回图像;
}
}捕获(可丢弃的e){
//错误
}
返回null;
}

你好,帕维尔,谢谢你的回复。你能详细说明一下从全尺寸JPEG文件中提取嵌入的缩略图是什么意思吗?现在,我需要一种方法来找到缩略图的路径,或者在我的代码中压缩库中的全尺寸图像。如有任何建议,将不胜感激。。谢谢你,阿什。看。您只需逐字节读取完整大小的图像,直到找到0xFFD8标记。这将是嵌入缩略图的开始。嗨,帕维尔,非常感谢!顺便说一句,我在新加坡国立大学有一位俄罗斯朋友,名叫帕维尔。。你让我想起了他!谢谢你的代码!:)此外,通常在诺基亚手机中,会存储两个缩略图,一个小,一个稍大。两个缩略图是否都存储在全尺寸JPEG文件中?或者有没有其他方法可以得到更小的缩略图?再一次谢谢你,阿什,你好。我不知道-你可以拍张照片然后检查一下。我认为缩略图的大小取决于设备。