Giter VIP home page Giter VIP logo

image-storage's Introduction

Website 🚀 contributte.org | Contact 👨🏻‍💻 paveljanda.com, f3l1x.io | Twitter 🐦 @contributte

Usage

To install latest version of contributte/image-storage use Composer.

composer require contributte/image-storage

Documentation

For details on how to use this package, check out our documentation.

Versions

State Version Branch Nette PHP
dev ^3.1.0 master 3.2+ >= 8.1
stable ^3.0.0 master 3.2+ >= 8.1

Development

See how to contribute to this package. This package is currently maintained by these authors.


Consider to support contributte development team. Also thank you for using this package.

image-storage's People

Contributors

adaamz avatar attreid avatar f3l1x avatar jvitasek avatar khorsky avatar mabar avatar martinknor avatar martinkokescz avatar ozzrell avatar paveljanda avatar pavelweirich avatar pecan987 avatar petrparolek avatar premekkoch avatar roman3349 avatar tremchez avatar vojtechmares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

image-storage's Issues

Bad rewrite rule for friendly url

If file has two dots in filename (img.2.jpg) final URL is broken => ..data/d7/img.100x100.fit.q100.2.jpg instead of img.2.100x100.fit.q100.jpg

assert(): Calling assert() with a string argument is deprecated when no image found

Hi,

First of all, thanks for this package. It currently suits my needs really well and improves the way I handle images in general.

I stumbled upon this issue. When an image is not found, it stops working because of the assert over here: image-storage/src/ImageStorage.php:281.

It is deprecated to use assert with string since PHP 7.2.0.

I am using PHP 7.3 and contributte/image-storage 2.0.5.

Cheers,
Patrik

Problém s novou verzí nette/application 3.2.x

Chyba:
Declaration of Contributte\ImageStorage\ImageStoragePresenterTrait::createTemplate(): Nette\Application\UI\ITemplate must be compatible with Nette\Application\UI\Presenter::createTemplate(?string $class = null): Nette\Application\UI\Template

při vytváření traity v souboru ImageStoragePresenterTrait.php řádek č.19

ImageNameScript

If the image is not found and is replaced by a definition in the configuration (default noimage_identifier: images/noimage/no-image.png) the path is not correctly parsed by the fromName method because the string "images/noimage/no-image.png" does not pass the preg_match pattern and the array is zero.

The solution was to set "noimage/01/no-image.png" in the configuration.

Image::createLink doesn't return link with $basePath

Hello,
I wanted to show image of user in datagrid, however Image::createLink method returns path without the $basePath variable.

public function columnName(User $user): Html
{
	$presenter = $this->getPresenter();
	$basePath = $presenter->getHttpRequest()->getUrl()->getBasePath();

	// Avatar
	$image = $this->imageStorage->fromIdentifier($user->getImage());
	$avatar = Html::el('img class="img-fluid img-circle mr-2" width="24px" alt="'.$user.'"')
		->setSrc($basePath.$image->createLink());

	// Link
	$link = $presenter->lazyLink('User:edit', $user->getId());
	$name = Html::el('a')->setHref($link)->addHtml($avatar)
		->addText($user->getName());

	return $name;
}

Support latte 3

Would it be possible to support latte/latte:3? I don't know how complicated that might be.

Thanks for considering this,
Patrik

ImageStorage using namespaces - bad RE usage

ImageStorage.php:123

If $script->name contains path (for me occurs when namespace is used) than RE failed. It is necessary to use preg_quote( $script->name, '/' ) to prevent such situation.

Quality of JPEG vs PNG images

Hi,
I have a question about quality of images. The quality is set with equal alue for both (jpg and png) types, but internally it uses the imagejpeg method for JPG (quality from 0 to 100) and imagepng for PNG (there is quality option from 0 to 9 - lower bigger quality). So the quality for these types is completely different at the result.

What we can to do with that? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.