Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
Deferring Tasks in Laravel Using Queues
Dec 18, 2017 @ 18:55:39

The TutsPlus.com site has a new tutorial posted for the Laravel users showing how to defer tasks to queues using functionality already included in the framework.

In this article, we're going to explore the Queue API in the Laravel web framework. It allows you to defer resource-intensive tasks during script execution to enhance the overall end user experience. After introducing the basic terminology, I'll demonstrate it by implementing a real-world example.

The article starts by talking about some of the advantages of using queues to help with reducing page load times and improving the overall performance/quality of your site's user experience. It then starts in on the Laravel-specific pieces of the queuing puzzle including the queue drivers, connection types and the queues themselves. Next they move on to the code, showing how to create a simple first job that will manipulate the images a user uploads. The post includes the code to create the "jobs" table, build the "Images" model and the "ProcessImageThumbnails" job that will build the smaller thumbnail images from larger ones. Finally they create the controller and views for the upload handling, show how to delegate it to the job for the image processing and run the queue processor do to the actual work.

tagged: laravel tutorial task queue delegate image processing thumbnail

Link: https://code.tutsplus.com/tutorials/deferring-tasks-in-laravel-using-queues--cms-29957

Mikko Koppanen:
Working on images asynchronously
Dec 16, 2013 @ 16:45:35

Mikko Koppanen has a new post to his site today about working with images asynchronously - the "offline" processing of things like user uploaded images using a queuing system.

To get my quota on buzzwords for the day we are going to look at using ZeroMQ and Imagick to create a simple asynchronous image processing system. Why asynchronous? First of all, separating the image handling from a interactive PHP scripts allows us to scale the image processing separately from the web heads. [...] Secondly, separating the image processing from a web script can provide more responsive experience to the user. This doesn’t necessarily mean faster, but let’s say in a multiple image upload scenario this method allows the user to do something else on the site while we process the images in the background.

He also includes a "barebones" example of how the system would work. The first Worker script makes the connection to the queue system and sends the data off for handling. The second script does most of the actual work, pulling in the image and using Imagick to create a thumbnail image. Finally he includes an example of the use of the workers in combination to send the image data for processing.

tagged: image asynchronous processing zeromq thumbnail imagick

Link: http://valokuva.org/working-on-images-asynchronously/

Philip Norton's Blog:
Creating A Thumbnail Of A Word Document With PHP And LiveDocx
Sep 26, 2011 @ 13:50:42

In a new post to his blog Philip Norton shares a method for creating a thumbnail of a Word document with the help of PHP and LiveDocx (in this case, the component inside the Zend Framework).

Creating Word document icons is very simple thanks to a service called LiveDocx. LiveDocx was created as a web service to allow the easy creation of most document formats from a simple template. However, it is possible to send a normal Word document as the template file and get an image of the file in return.

You'll need a LiveDocx account to be able to use the service - there's a free option of their service that uses a shared server. Included in the post is a sample script that defines a LiveDocx connection, pulls in a local Word document for parsing and calls a "getBitmaps" method on the service to return the raw image data. This is pushed into an image (using GD) as a PNG.

tagged: word document livedocx zendframework webservice image thumbnail

Link:

Sameer Borate's Blog:
Easy thumbnail generation using PHP
Mar 25, 2011 @ 13:19:57

Sameer Borate has a recent post to his blog looking at a PHP_Thumb tool.

One of the frequent requirements in web design is that of thumbnail generation. Although there are many libraries out there I found PHP Thumb simple and quick enough to implement in a recent project. PHP Thumb is a light-weight image manipulation library aimed at thumbnail generation. It offers the ability to resize, create custom crops, or square crops from the center, and rotate the image. If the need arises you can also easily add custom functionality to the library through plugins.

Code examples are, of course, included in the post showing simple thumbnail creation, image rotation, cropping, resizing and outputting to a different format. There's a brief mention of custom plugins and the ability to chain functions.

tagged: thumbnail generation phpthumb generation tutorial

Link:

Codrops Blog:
Fresh Sliding Thumbnails Gallery with jQuery and PHP
Jun 29, 2010 @ 17:37:21

On the Codrops blog there's a recent tutorial posted showing how to create a fully-functional image slider/viewer with a combination of HTML, jQuery and a bit of PHP (here's a demo).

In this tutorial we are going to create another full page image gallery with a nice thumbnail area that scrolls automatically when moving the mouse. The idea is to allow the user to slightly zoom into the picture by clicking on it. The thumbnails bar slides down and the image resizes according to the screen size.

Based on this tutorial, they show you how to build on it and add a few new features like a changing cursor depending on its position in the current image. The show the folder structure you'll need, the HTML and PHP to make the backend work and the CSS and Javascript to round out the frontend. If you want to skip straight to the good stuff you can also just download all the code and get started.

tagged: tutorial sliding photo thumbnail gallery jquery css

Link:

Lorenzo Alberton's Blog:
Create a video preview as animated GIF with FFmpeg and PHP SPL
Sep 04, 2009 @ 14:52:50

Lorenzo Alberton has posted a new item to his blog with a code snippet showing the combination of FFmpeg and features in PHP's SPL to make a GIF preview.

About one year ago, I had to create animated GIFs as a preview of a video for a media portal. I recently stumbled upon the code I wrote and thought it was probably worth sharing. It makes a rather unconventional use of the SPL Iterators, proving how flexible they are.

His method combines Imagick, FFmpeg and a a Thumbnail_Extractor class that extends the SPL Iterator. The script runs through the frames of the movie file and allows you to define multiple places to pull thumbnails from. Complete code and output examples are included.

tagged: animated gif tutorial ffmpeg movie thumbnail spl

Link:

NETTUTS.com:
Learning OOP in PHP ASAP!
Jan 20, 2009 @ 15:36:36

NETTUTS.com has posted an introduction (using the Car analogy, of course) to teach you how to use the basics of object-oriented programming in PHP.

PHP is so much more than a scripting language. It's a full-fledged language capable of building very complex applications. By harnessing the full power of Object Oriented Programming, you can reduce the amount of time you spend coding and use it to build better websites. This tutorial will show you how.

They explain objects, inheritance, encapsulation and polymorphism briefly before "getting their hands dirty" with some actual OOP PHP code. Their code example sets up a thumbnailer class - one that takes in an image, a height/width you want to resize it to (as properties) and splits it back out the other side.

As always, you can grab the source or view the demo to see it work.

tagged: tutorial thumbnail oop object oriented introduction

Link:

NETTUTS.com:
How to Dynamically Create Thumbnails
Nov 21, 2008 @ 16:31:25

The NETTUTS.com blog has a new screencast posted showing how to create a simple thumbnailing script you can use in any application (like an image gallery).

In this week's screencast, I'll show you how to upload files and then have PHP dynamically create a thumbnail. Whether you're building an ecommerce site, or just a simple gallery, these techniques will absolutely prove to be useful. If you're ready for your "spoonfed" screencast of the week, let's get going!

The post also includes all of the code and HTML that you'll need to get it up and running (very cut and paste-able).

tagged: dynamic thumbnail screencast gallery tutorial

Link:

Cory Borrow's Blog:
Creating thumbs from textfiles with PHP and GD
Jan 16, 2008 @ 18:50:00

Cory Borrow has posted a tutorial he's created to show how to harness the power of PHP and GD to create thumbnail images out of the contents of a text file.

Today, I'll give a little info on how to achieve the process of creating a thumbnail using PHP, GD and the text from a text file. It is really pretty simple, so lets get started.

The trick behind the translation is in reading in the contents of the (plain) text file and pushing it into a string value of a newly created GD-generated image. He includes the code to make using it in your own app simple (a cut and paste version) - his method FileToThumb.

tagged: thumbnail image gd tutorial text file contents thumbnail image gd tutorial text file contents

Link:

Cory Borrow's Blog:
Creating thumbs from textfiles with PHP and GD
Jan 16, 2008 @ 18:50:00

Cory Borrow has posted a tutorial he's created to show how to harness the power of PHP and GD to create thumbnail images out of the contents of a text file.

Today, I'll give a little info on how to achieve the process of creating a thumbnail using PHP, GD and the text from a text file. It is really pretty simple, so lets get started.

The trick behind the translation is in reading in the contents of the (plain) text file and pushing it into a string value of a newly created GD-generated image. He includes the code to make using it in your own app simple (a cut and paste version) - his method FileToThumb.

tagged: thumbnail image gd tutorial text file contents thumbnail image gd tutorial text file contents

Link:


Trending Topics: