Commit c93ae922 by Li Feifei

a

parent f05cab07
......@@ -460,6 +460,7 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
}
defer fc.Close()
//item := syncPool.Borrow()
//defer item.Return()
//item.MarkAsInvalid()
......@@ -471,7 +472,6 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
switch fileSuffix {
case ".png":
img, _ = png.Decode(fc)
case ".jpeg":
img, _ = jpeg.Decode(fc)
default:
......@@ -495,8 +495,12 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
imageInfo = append(imageInfo, fileName)
imageInfo = append(imageInfo, info.Max.X)
imageInfo = append(imageInfo, info.Max.Y)
return imageInfo, bucket.PutObject(objectPathName+fileName, fc)
fc1, err := file.Open()
if err != nil {
return nil, err
}
defer fc1.Close()
return imageInfo, bucket.PutObject(objectPathName+fileName, fc1)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment