Changeset 15284


Ignore:
Timestamp:
04/16/12 01:25:16 (11 years ago)
Author:
nit
Message:

fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/thumb.h

    r15281 r15284  
    22#define THUMB_H
    33
    4 char* checkthumb(char* file)
     4char* checkthumb(char* path, char* file)
    55{
    6         return ostrcat(file, ".thumb.jpg", 0, 0);
     6        char* tmpstr = NULL;
     7       
     8        tmpstr = ostrcat(createpath(path, "/.Thumbnails/"), file, 1, 0);
     9        if(file_exist(tmpstr))
     10                return tmpstr;
     11       
     12        return NULL;
    713}
    814
     
    1218        unsigned char* buf = NULL;
    1319        struct queue* qe = NULL;
    14         char* thumbfile = NULL, *tmpstr = NULL;
     20        char* thumbfile = NULL;
    1521
    1622        if(self == NULL) return;
     
    3137                                if(buf != NULL)
    3238                                {
    33                                         tmpstr = ostrcat((char*)qe->data, NULL, 0, 0);
    34                                         tmpstr = dirname(tmpstr);
    35                                         tmpstr = ostrcat(tmpstr, "/.Thumbnails", 1, 0);
    36                                         mkdir(tmpstr, 777);
    37                                         free(tmpstr); tmpstr = NULL;
     39                                        thumbfile = ostrcat(thumbfile, (char*)qe->data, 1, 0);
     40                                        thumbfile = ostrcat(thumbfile, "/.Thumbnails", 1, 0);
     41                                        mkdir(thumbfile, 777);
     42                                       
     43                                        thumbfile = ostrcat(thumbfile, "/", 1, 0);
     44                                        thumbfile = ostrcat(thumbfile, (char*)qe->data1, 1, 0);
    3845
    39                                         thumbfile = ostrcat((char*)qe->data, ".thumb.jpg", 1, 0);
    4046                                        debug(307, "create thumb: %s from %s", thumbfile, (char*)qe->data);
    4147                                        savejpg(thumbfile, 100, 100, buf);
     
    4652                        free(thumbfile); thumbfile = NULL;
    4753                        delqueue(qe, 0);
    48                         qe = getqueue(dvbnode->devnr);
     54                        qe = getqueue(101);
    4955                }
    5056        }
Note: See TracChangeset for help on using the changeset viewer.