Lines Matching refs:media_file
136 …public function mediaFileResponse(MediaFile $media_file, bool $add_watermark, bool $download): Res… argument
138 $filesystem = $media_file->media()->tree()->mediaFilesystem();
139 $path = $media_file->filename();
141 if (!$add_watermark || !$media_file->isImage()) {
146 $mime_type = $media_file->mimeType();
148 … $this->createWatermark(width: $image->width(), height: $image->height(), media_file: $media_file);
171 MediaFile $media_file, argument
178 $filesystem = $media_file->media()->tree()->mediaFilesystem();
181 $path = $media_file->filename();
187 $media_file->media()->tree()->name(),
196 … function () use ($filesystem, $path, $width, $height, $fit, $add_watermark, $media_file): string {
201 … $this->createWatermark(width: $image->width(), height: $image->height(), media_file: $media_file);
207 … return $image->encodeByMediaType(type: $media_file->mimeType(), quality: $quality)->toString();
233 public function fileNeedsWatermark(MediaFile $media_file, UserInterface $user): bool argument
235 $tree = $media_file->media()->tree();
243 public function thumbnailNeedsWatermark(MediaFile $media_file, UserInterface $user): bool argument
245 return $this->fileNeedsWatermark(media_file: $media_file, user: $user);
251 public function createWatermark(int $width, int $height, MediaFile $media_file): ImageInterface argument