File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ export async function POST(req: Request) {
57
57
) ;
58
58
} else {
59
59
finalUrl = urls [ 0 ] ;
60
- const thumbnailResponse = cloudinary . v2 . url ( finalUrl ! , {
61
- format : "jpg" ,
62
- page : 1 ,
63
- transformation : [ { width : 300 , height : 400 , crop : "fit" } ] ,
64
- } ) ;
65
- thumbnailUrl = thumbnailResponse ;
60
+ const thumbnailResponse = cloudinary . v2 . image ( finalUrl ! , { format : "jpg" } ) ;
61
+ thumbnailUrl = thumbnailResponse
62
+ . replace ( "pdf" , "jpg" )
63
+ . replace ( "upload" , "upload/w_400,h_400,c_fill" )
64
+ . replace ( / < i m g s r c = ' | ' \s * \/ > / g , '' ) ;
65
+
66
66
const paper = new Paper ( {
67
67
finalUrl,
68
68
thumbnailUrl,
@@ -75,7 +75,7 @@ export async function POST(req: Request) {
75
75
}
76
76
77
77
return NextResponse . json (
78
- { status : "success" , url : finalUrl } ,
78
+ { status : "success" , url : finalUrl , thumbnailUrl : thumbnailUrl } ,
79
79
{ status : 201 } ,
80
80
) ;
81
81
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments