Commit c93ae922 by Li Feifei

a

parent f05cab07
...@@ -460,6 +460,7 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte ...@@ -460,6 +460,7 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
} }
defer fc.Close() defer fc.Close()
//item := syncPool.Borrow() //item := syncPool.Borrow()
//defer item.Return() //defer item.Return()
//item.MarkAsInvalid() //item.MarkAsInvalid()
...@@ -471,7 +472,6 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte ...@@ -471,7 +472,6 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
switch fileSuffix { switch fileSuffix {
case ".png": case ".png":
img, _ = png.Decode(fc) img, _ = png.Decode(fc)
case ".jpeg": case ".jpeg":
img, _ = jpeg.Decode(fc) img, _ = jpeg.Decode(fc)
default: default:
...@@ -495,8 +495,12 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte ...@@ -495,8 +495,12 @@ func pdfThumbnail(objectPath string, file *zip.File, bucket *oss.Bucket) ([]inte
imageInfo = append(imageInfo, fileName) imageInfo = append(imageInfo, fileName)
imageInfo = append(imageInfo, info.Max.X) imageInfo = append(imageInfo, info.Max.X)
imageInfo = append(imageInfo, info.Max.Y) imageInfo = append(imageInfo, info.Max.Y)
fc1, err := file.Open()
return imageInfo, bucket.PutObject(objectPathName+fileName, fc) 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