Example #1
0
        private void makeSmall(Object objParam)
        {
            List <User> userList = getByStartEndId(objParam as ThumbParam);

            foreach (User user in userList)
            {
                lastId = user.Id;

                if (picExist(user.Pic, ThumbnailType.Small))
                {
                    log("pic exist=id" + user.Id + ", pic=" + user.Pic + ", small");
                    continue;
                }

                int x = config.Instance.Site.AvatarThumbWidth;
                int y = config.Instance.Site.AvatarThumbHeight;

                String srcPath = getSrcPath(user.Pic);
                if (file.Exists(srcPath) == false)
                {
                    log("pic original not exist=" + srcPath);
                    continue;
                }

                log("begin make small=>" + srcPath);
                AvatarUploader.saveAvatarPrivate(x, y, srcPath, ThumbnailType.Small);
            }

            log("操作结束, last user id=" + lastId);
        }
Example #2
0
        private void makeBig(Object objParam)
        {
            List <User> userList = getByStartEndId(objParam as ThumbParam);

            foreach (User user in userList)
            {
                lastId = user.Id;

                if (picExist(user.Pic, ThumbnailType.Big))
                {
                    log("pic exist=id" + user.Id + ", pic=" + user.Pic + ", big");
                    continue;
                }

                int    x       = config.Instance.Site.AvatarThumbHeightBig;
                int    y       = config.Instance.Site.AvatarThumbWidthBig;
                String srcPath = getSrcPath(user.Pic);
                if (file.Exists(srcPath) == false)
                {
                    log("pic original not exist=" + srcPath);
                    continue;
                }
                log("begin make big=>" + srcPath);

                Boolean formatValid = AvatarUploader.saveAvatarPrivate(x, y, srcPath, ThumbnailType.Big);
                if (formatValid == false)
                {
                    msgList.Add("■■■■■■ format error=" + srcPath);
                }
            }

            log("操作结束, last user id=" + lastId);
        }