No need to pre-generate thumbnails anymore
Qvitter fixed their queet-expand-view! By not making thumbnails on upload we'll save a bit of time and resources, saving the post much quicker.
This commit is contained in:
		@@ -75,16 +75,7 @@ class ApiMediaUploadAction extends ApiAuthAction
 | 
				
			|||||||
        // we could catch "NoUploadedMediaException" as "no media uploaded", but here we _always_ want an upload
 | 
					        // we could catch "NoUploadedMediaException" as "no media uploaded", but here we _always_ want an upload
 | 
				
			||||||
        $upload = MediaFile::fromUpload('media', $this->scoped);
 | 
					        $upload = MediaFile::fromUpload('media', $this->scoped);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Hack to make a thumbnail before giving back a response
 | 
					        // Thumbnails will be generated/cached on demand when accessed (such as with /attachment/:id/thumbnail)
 | 
				
			||||||
        // (the file should instead actually be attached to a notice in the file_to_post table)
 | 
					 | 
				
			||||||
        try {
 | 
					 | 
				
			||||||
            if ($upload->fileRecord instanceof File) {
 | 
					 | 
				
			||||||
                $upload->fileRecord->getThumbnail();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        } catch (Exception $e) {
 | 
					 | 
				
			||||||
            common_debug(sprintf('A hack is buggy: MediaFile fileRecord could not getThumbnail for file id==%u',
 | 
					 | 
				
			||||||
                                 $upload->fileRecord->id));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->showResponse($upload);
 | 
					        $this->showResponse($upload);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user