Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.3', '8.4', '8.5' ]
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
imagemagick: [ '6.9.13-50', '7.1.2-25' ]
imagick: [ '3.8.1' ]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.3-cli
FROM php:8.1-cli

ARG IMAGEMAGICK_VERSION=7.1.2-25

Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "intervention/image",
"name": "openregion/image",
"description": "PHP Image Processing",
"homepage": "https://image.intervention.io",
"homepage": "https://github.com/openregion/image",
"keywords": [
"image",
"gd",
Expand All @@ -16,15 +16,22 @@
"name": "Oliver Vogel",
"email": "oliver@intervention.io",
"homepage": "https://intervention.io"
},
{
"name": "CIT Open Region",
"homepage": "https://www.openregion.info/"
}
],
"require": {
"php": "^8.3",
"php": "^8.1",
"ext-mbstring": "*",
"intervention/gif": "^5"
"openregion/gif": "^5.0"
},
"replace": {
"intervention/image": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "^12.0",
"phpunit/phpunit": "^10.5 || ^11.0 || ^12.0",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^2.1",
"squizlabs/php_codesniffer": "^4",
Expand Down
14 changes: 9 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Intervention Image
## PHP Image Processing

[![Latest Version](https://img.shields.io/packagist/v/intervention/image.svg)](https://packagist.org/packages/intervention/image)
[![Build Status](https://github.com/Intervention/image/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Intervention/image/actions)
[![Monthly Downloads](https://img.shields.io/packagist/dm/intervention/image.svg)](https://packagist.org/packages/intervention/image/stats)
[![Latest Version](https://img.shields.io/packagist/v/openregion/image.svg)](https://packagist.org/packages/openregion/image)
[![Build Status](https://github.com/openregion/image/actions/workflows/run-tests.yml/badge.svg)](https://github.com/openregion/image/actions)
[![Monthly Downloads](https://img.shields.io/packagist/dm/openregion/image.svg)](https://packagist.org/packages/openregion/image/stats)
[![Support me on Ko-fi](https://raw.githubusercontent.com/Intervention/image/develop/.github/images/support.svg)](https://ko-fi.com/interventionphp)

Intervention Image is a **PHP image processing library** that provides a simple
and expressive way to create, edit, and compose images. It comes with a universal
interface for the popular PHP image manipulation extensions. You can
choose between the GD library, Imagick or libvips as the base layer for all operations.

This repository contains the `openregion/image` fork maintained for PHP 8.1+ compatibility.

- Fluent interface for common image editing tasks
- Interchangeable driver architecture with support for **GD, Imagick and libvips**
- Support for animated images with all drivers
Expand All @@ -21,7 +23,7 @@ choose between the GD library, Imagick or libvips as the base layer for all oper
Install this library using [Composer](https://getcomposer.org). Add the package with the following command:

```bash
composer require intervention/image
composer require openregion/image
```

## Getting Started
Expand Down Expand Up @@ -61,7 +63,7 @@ $encoded->save('images/example.jpg');

Ensure that your server environment meets the following requirements before installation:

- PHP >= 8.3
- PHP >= 8.1
- Mbstring PHP Extension
- Image Processing PHP Extension (GD, Imagick or libvips)

Expand All @@ -82,6 +84,8 @@ If you discover any security related issues, please email oliver@intervention.io

This library is developed and maintained by [Oliver Vogel](https://intervention.io)

This fork is co-maintained by [CIT Open Region](https://www.openregion.info/).

Thanks to the community of [contributors](https://github.com/Intervention/image/graphs/contributors) who have helped to improve this project.

## License
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Cmyk/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class StringColorDecoder extends AbstractDecoder implements DecoderInterface
{
private const string PATTERN =
private const PATTERN =
'/^cmyk ?\(' .
'(?P<c>[0-9\.]+%?)((, ?)| )' .
'(?P<m>[0-9\.]+%?)((, ?)| )' .
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Hsl/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern of HSL color syntax
*/
private const string PATTERN =
private const PATTERN =
'/^hsla? ?\( ?' .
'(?P<h>[0-9\.]+)(?:deg)?((, ?)| )' .
'(?P<s>[0-9\.]+%?)((, ?)| )' .
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Hsv/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern of hsv/b color syntax.
*/
private const string PATTERN =
private const PATTERN =
'/^hs(v|b) ?\( ?(' .
'?P<h>[0-9\.]+)(?:deg)?((, ?)| )' .
'(?P<s>[0-9\.]+%?)((, ?)| )' .
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Oklab/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern of oklab color syntax.
*/
private const string PATTERN =
private const PATTERN =
'/^oklab ?\( ?' .
'(?P<l>(1|0|0?\.[0-9]+)|[0-9\.]+%)((, ?)|( ))' .
'(?P<a>(-?0|-?0?\.[0-9\.]+)|(-?[0-9\.]+%))((, ?)|( ))' .
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Oklch/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern for oklch color syntax.
*/
protected const string PATTERN =
protected const PATTERN =
'/^oklch ?\( ?' .
'(?P<l>(1|0|0?\.[0-9]+)|[0-9\.]+%)((, ?)|( ))' .
'(?P<c>(-?0|-?0?\.[0-9\.]+)|(-?[0-9\.]+%))((, ?)|( ))' .
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Rgb/Decoders/HexColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HexColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern of hexadecimal color syntax.
*/
protected const string PATTERN = '/^#?(?P<hex>[a-f\d]{3}(?:[a-f\d]?|(?:[a-f\d]{3}(?:[a-f\d]{2})?)?)\b)$/i';
protected const PATTERN = '/^#?(?P<hex>[a-f\d]{3}(?:[a-f\d]?|(?:[a-f\d]{3}(?:[a-f\d]{2})?)?)\b)$/i';

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Colors/Rgb/Decoders/StringColorDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
/**
* Regex pattern of rgb color syntax.
*/
private const string PATTERN =
private const PATTERN =
'/^s?rgba? ?\( ?' .
'(?P<r>[0-9]{1,3})([, ]) ?' .
'(?P<g>[0-9]{1,3})\2 ?' .
Expand Down
2 changes: 1 addition & 1 deletion src/DataUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DataUri implements DataUriInterface
/**
* Pattern of data uri scheme.
*/
protected const string PATTERN = "/^data:(?P<mediaType>\w+\/[-+.\w]+)?" .
protected const PATTERN = "/^data:(?P<mediaType>\w+\/[-+.\w]+)?" .
"(?P<parameters>(;[-\w]+=[-\w]+)*)(?P<base64>;base64)?,(?P<data>.*)/";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/AbstractEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class AbstractEncoder implements EncoderInterface
/**
* Default encoding quality.
*/
public const int DEFAULT_QUALITY = 75;
public const DEFAULT_QUALITY = 75;

/**
* {@inheritdoc}
Expand Down
4 changes: 2 additions & 2 deletions src/InputHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class InputHandler implements InputHandlerInterface
/**
* All available image decoders.
*/
public const array IMAGE_DECODERS = [
public const IMAGE_DECODERS = [
ImageObjectDecoder::class,
NativeObjectDecoder::class,
StreamImageDecoder::class,
Expand All @@ -52,7 +52,7 @@ class InputHandler implements InputHandlerInterface
/**
* All available color decoders.
*/
public const array COLOR_DECODERS = [
public const COLOR_DECODERS = [
NamedColorDecoder::class,
ColorObjectDecoder::class,
RgbHexColorDecoder::class,
Expand Down
16 changes: 8 additions & 8 deletions tests/Feature/AutoOrientationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

class AutoOrientationTest extends BaseTestCase
{
private const array LANDSCAPE_TOP_LEFT = [2, 2];
private const array LANDSCAPE_TOP_RIGHT = [50, 2];
private const array LANDSCAPE_BOTTOM_LEFT = [2, 20];
private const array LANDSCAPE_BOTTOM_RIGHT = [50, 20];
private const array PORTRAIT_TOP_LEFT = [2, 2];
private const array PORTRAIT_TOP_RIGHT = [20, 2];
private const array PORTRAIT_BOTTOM_LEFT = [2, 50];
private const array PORTRAIT_BOTTOM_RIGHT = [20, 50];
private const LANDSCAPE_TOP_LEFT = [2, 2];
private const LANDSCAPE_TOP_RIGHT = [50, 2];
private const LANDSCAPE_BOTTOM_LEFT = [2, 20];
private const LANDSCAPE_BOTTOM_RIGHT = [50, 20];
private const PORTRAIT_TOP_LEFT = [2, 2];
private const PORTRAIT_TOP_RIGHT = [20, 2];
private const PORTRAIT_BOTTOM_LEFT = [2, 50];
private const PORTRAIT_BOTTOM_RIGHT = [20, 50];

/**
* @param array<array{'position': array<int>, 'colors': array<int>}> $colors
Expand Down