Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图书打开为空白,无法阅读 #57

Open
SFight opened this issue Jun 26, 2018 · 2 comments
Open

图书打开为空白,无法阅读 #57

SFight opened this issue Jun 26, 2018 · 2 comments

Comments

@SFight
Copy link

SFight commented Jun 26, 2018

default
default
打开图书为空白整本图书无法阅读。图书为《视频专业英语文选(第二版)》,使用iBooks是可以打开的。

@SFight
Copy link
Author

SFight commented Jul 2, 2018

NSString+HTML.m文件的102行导致内容无法展示,目前还不知道这个if判断是用来做什么,但是会导致这本书打开都是空白,注视掉后则可以显示了。
if ([scanner scanString:@"title" intoString:NULL]) {
[scanner scanUpToString:@"</title>" intoString:NULL];
[scanner scanString:@"</title>" intoString:NULL];
}

@gaici
Copy link

gaici commented Aug 6, 2018

epub里面有的img标签是image
在LSYChapterModel.m 92行

else if ([scanner scanString:@"" intoString:NULL]) {
NSString *img;
[scanner scanUpToString:@"" intoString:&img];
NSString *imageString = [[kDocuments stringByAppendingPathComponent:self.epubImagePath] stringByAppendingPathComponent:img];
UIImage *image = [UIImage imageWithContentsOfFile:imageString];

        CGFloat width = ScreenSize.width - LeftSpacing - RightSpacing;
        CGFloat height = ScreenSize.height - TopSpacing - BottomSpacing;
        CGFloat scale = image.size.width / width;
        CGFloat realHeight = image.size.height / scale;
        CGSize size = CGSizeMake(width, realHeight);
        
        if (size.height > (height - 20)) {
            size.height = height - 20;
        }
        [array addObject:@{@"type":@"img",@"content":imageString?imageString:@"",@"width":@(size.width),@"height":@(size.height)}];
        //存储图片信息
        LSYImageData *imageData = [[LSYImageData alloc] init];
        imageData.url = imageString?imageString:@"";
        if (imageArray.count) {
            imageData.position = newString.length + imageArray.count;
        } else {
            imageData.position = newString.length;
        }
        //            imageData.imageRect = CGRectMake(0, 0, size.width, size.height);
        [imageArray addObject:imageData];
        
        //            [newString appendString:@" "];
        [scanner scanString:@"</image>" intoString:NULL];
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants