Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
use Spatie\Image\Image; use Spatie\Image\Enums\AlignPosition; use Spatie\Image\Enums\Unit; Image::load(storage_path('app/public/input.jpg')) // 1. Größe anpassen (Fit kombiniert Resize & Crop) ->fit(800, 600) // 2. Text mit Hintergrund hinzufügen // Spatie erlaubt es, Text-Eigenschaften in einer Closure zu definieren ->text('Ihr Text hier', function($font) { $font->file(public_path('fonts/Roboto-Bold.ttf')) ->size(40) ->color('ffffff') ->width(700) // Maximale Breite des Textblocks ->align(AlignPosition::Center) // Hier tricksen wir: Der Hintergrund wird direkt am Text ausgerichtet ->background('rgba(0, 0, 0, 0.6)') ->padding(20); // Abstand zwischen Text und Hintergrundbox }) // Position des Textblocks auf dem Gesamtbild ->textPosition(AlignPosition::Bottom) ->save(storage_path('app/public/output.jpg'));
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)