Image Image Image Image Image
Scroll to Top

To Top

News Articles

03

Jul
2017

News Articles

Permalink

By admin404

FileChecker WordPress Plugin

July 3, 2017 - News Articles

Those who attempt to seize control of WordPress sites often do so by burying obfuscated code in the PHP scripts of plugins, themes or the WordPress core. This is done through various exploits in improperly secured PHP, less-restricted file system permissions, or server counter-measures. Read more…

Tags | base64_decode, eval, filechecker, fwrite, grep, gzinflate, malicious code, plug-in, plugin, protect, protection, secure, security, str_rot13, virus, word press, wordpress, wp

04

Apr
2015

News Articles

Permalink

By admin404

CropRefine WordPress Plugin

April 4, 2015 - News Articles

When an article is published in WordPress, it could likely appear across several of the internal templates, besides just the single post page. For example, you may see “Recent Articles” on the home page sidebar or footer, “Related Articles” at the bottom of other posts, and “Search Results” may show excerpts with thumbnails to help readers to quickly find relevant results. These other applications of featured images not only direct readers to the freshest content, but they also notify search indexers of changes to a WordPress sitemap. This boosts the credibility of the site and its author by showing that the site is maintained and current, and offering cross-links to promote relevance. Read more…

Tags | blog, croprefine, distort, era404, featured image, fix, limitation, plugin, recrop, refine, shortcoming, thumbnail, upload, wordpress

27

May
2014

News Articles

Permalink

By admin404

Mobile Apps and Chunk Uploads

May 27, 2014 - News Articles

Higher camera resolutions, retina pixel densities and broader bandwidth have given us the web with greater, more beautiful detail. And the HTML5 canvas element now gives us the ability to manipulate imagery armed with nothing more than Javascript. But, as with all growth, there are growing pains, and this one can be found in the

Error Code 413:

Request Entity Too Large.

Mozilla’s error code detail says: “Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.”

https://developer.mozilla.org/en-US/docs/Web/HTTP/Response_codes

Essentially, you’re transmitting the decoded pixel information, 4 bytes at a time (1 byte for each, RGB and Alpha). A byte is hardly going to bust the server limits, but for even a 1-megapixel photo (1200×900), this amounts to 4,320,000 bytes. Most digital phone cameras have capabilities much higher, so you can see how this issue might suddenly become a big possibility in your own web or mobile application.

But if you don’t have access to change some of these server directives, and if you’re working with canvas elements and wish to transmit some very high-resolution pixel data, using toDataUrl(), for example, you might be bumping into this grumpy error code often.

With toDataURL, you can pass an optional argument to prepare the canvas pixel data as a JPEG file, which is generally much smaller than the default PNG format. But not all browsers and phones support this enhancement, such as a Samsung Galaxy SIII, so you now you’ve got to plan for this liability.

 

Chunk Uploading

The traditional solution for sending any payload without reaching a limit is to break it down into parts, and transmit in sequence. It’s how space stations, carnivals, and even the Statue of Liberty was transported. In our mobile apps, we can do it with jQuery, just like this:

var can = document.getElementById("canvas");
var imagedata = can.toDataURL("image/jpeg"); //this will still be a PNG on some phones/browsers
var hash = [any unique id here];
//break the image up into chunks
function chunkup(imagedata, hash){
	var chunks = imagedata.match(/.{1,500000}/g); //break the imagedata into manageable parts
	for (part in chunks){
		var islast = ((part-0)+1 >= chunks.length ? 1 : 0);
		chunkupload(part, chunks[part], hash, islast); //send the chunks, one at a time
	}
}
//transmit each, one at a time
function chunkupload(part, chunk, hash, last) {
    var data = {"chunk": chunk, "hash": hash, "part": part, "last": last};
    $.ajax({
        type: "POST",
        url: "http://path/to/your/server/script.php",
        data: data,
        dataType: "JSON",
        timeout: 60 * 1000,
        async: false
    }).done(function (data) {
		return;
    }).fail(function (XMLHttpRequest, textStatus, errorThrown) {
        alert("Error: "+errorThrown);
    });
}

You can run this function synchronously, but you might also be pushing another limit for maximum simultaneous requests. So even if it’s slower, it might be worth your while to perform these uploads in sequence, instead.

On the server side, we’re getting image data “chunks” fired at us, so our script must be smart enough to store these chunks temporarily for later reassembly. PHP is terrific for reading and writing to the file system. So here’s an example of how this is done in PHP:

header('Content-type: application/json');
if(!empty($_POST)){
	if(isset($_POST['chunk']) && isset($_POST['hash']) && isset($_POST['part'])) {
		$hash = (string) trim($_POST['hash']);
		$part = (integer) trim($_POST['part']);
		$last = (boolean) trim($_POST['last']);
		//save the data to temporary sequential files on the filesystem
		$filename = "tmp/chunk/{$hash}.{$part}";
		if($fp = fopen($filename,"w"))
		{	$contents = fwrite($fp, (string) trim($_POST['chunk']));
			fclose($fp);
		}
		//if all of the parts have been received, let’s reassemble
		if($last){
			$composite = ""; $chunk = 0;
			while($chunk <= $part){
				if(file_exists("tmp/chunk/{$hash}.{$chunk}")){
					$composite .= trim(implode("",file("tmp/chunk/{$hash}.{$chunk}")));
					//we don’t need the chunk file anymore
					unlink("tmp/chunk/{$hash}.{$chunk}");
				}
				$chunk+=1;
			}
			$filename = "tmp/{$hash}.jpg";
			//strip out the imagetype header
			preg_match("/data\:image\/([png|jpeg]*)\;base64\,(.*)/", $composite, $img);
			if(count($img)==3){
				$rawdata = imagecreatefromstring(base64_decode($img[2]));
				imagejpeg($rawdata, $filename);
			}
			//send the good news, your image has been transmitted!
			if(file_exists($filename)) die( json_encode( array("filename" => $hash) ));
		}
	}
}
//let AJAX know you got the chunk
die( json_encode( array("1") ));

That’s all there is to it!

There are countless mods (sanitizing, security, accounts, filetype handlers, etc.) that can be worked into this workflow, but now you can concentrate on your customizations and not have to worry about error code 413.

Tags | chunk upload, hi-rez, high resolution, information, javascript, jpeg, jpg, jquery, megabytes, megapixels, mozilla, pixel, png, request entity, retry-after, todataurl

15

Jan
2014

News Articles

Permalink

By admin404

FoundationTables WordPress Plugin

January 15, 2014 - News Articles

Succeeding the popularity of Zurb’s famous framework, FoundationTables is a WordPress plugin written by ERA404 to harness the responsiveness the framework provides, and extend the WordPress page editor with a new toolset to easily insert, edit, style and delete Foundation-ready tables. Read more…

Tags | beautiful, blog, clean, foundation, foundationtables, html, layout, plugin, tables, tabular data, wordpress, zurb

02

Dec
2013

News Articles

Permalink

By admin404

The Ryanair of Design

December 2, 2013 - News Articles

For frugal latitudinarians, Ryanair is a blessing. You can find tickets for as little as €1 to whisk you off to a growing set of your favorite European cities. They truly are the GoDaddy of airlines, with an inexpensive base price, a million options for billable add-ons, and even their CEO, Michael O’Leary, projects a similar public persona to GoDaddy’s Bob Parsons.

The convenience of Ryanair is part of a growing trend to provide consumers with a competitive base price, tacking on inexpensive à la carte options for anything they need. With Amazon’s Longtail model and online service providers—think VistaPrint—offering LQLC (lower quality, lower cost) merchandise for pennies on the dollar, consumers have a broader and more diverse array of choices than ever before.. If cost is more important than quality, comfort, or customization, penny-savers, this new model of service is for you!

So what if ERA404 changed our business model to match Ryanair? Imagine you’re seeking a new identity for your business and have submitted an RFP to ten design firms, including ERA404.  When all proposals come in, you have a ballpark of $50,000 from nine studios and $15,000 from us. Your first thought was that ERA404 either provides offshore labor or maybe we missed a few pages in your RFP. But no, we reply, this is the price. One identity system: $15,000 (a total of $35,000 in savings over our competition).

It’s then that you take a look at the fine print. One (1) logo costs $15,000, but we’re happy to offer you some options. You can receive additional thumbnail sketches at $50/sketch, additional rough sketches for $100/rough, and additional refined logo concepts for $250/concept. Interested in seeing samples in different palettes or typefaces, that’ll only cost you $100/ea. Want variations of how the logo can be applied with and without a tagline? Stacked versus vertical? Simplified for clothing hangtags and favicons? Each modification will cost you, but you should still come out ahead since the base offering was massively discounted. Right?

And don’t forget about artwork provision by courier or digital transmission, we’ll need to get the files to you somehow and that won’t come cheap. Similar to Ryanair’s model, jokingly referred to as the Pay-Per-Pee airline, a $40 ticket actually costs something closer to $65, with a mandatory “convenient” online check-in fee imposed on every ticket. This is similar to a design firm telling you there is a fee each time they type up an invoice to bill you for the work they have have yet to perform.

So by the time the project is completed and all the add-on costs are tabulated, your $15,000 may be closer to $45,000 and CFOs will rejoice at the overall savings of $5,000 over the competing quotes. However the enjoyment of the experience, the satisfaction with the outcome, and the quality of the work performed would diminish greatly. Here’s why:

In the world of design, continuing with Identity Design as an example, the process grows organically. Pentagram partner and identity design extraordinaire, Paula Scher, may doodle an arch over the word Citi on a napkin in an introductory meeting with Traveler’s Bank. HermanMiller may spend a solid year and hundreds of millions of dollars churning out concepts for an updated brand that results in simply encapsulating the previous in a circle. Either way, the process can be planned, but organic design should never go according to plan. It can be organized and directed, but creative development isn’t something that follows a strictly controlled organization or direction. Restricting the number of sketches based on dollar amounts (or Pay-Per-Tweak) not only desiccates the fluidity of the process, but decimates the possibility of creativity. Read: you’ll arrive at your destination, but you won’t enjoy the voyage.

Services like air travel and digital printers and crowd-sourced identity design can survive because they cater to our frugal nature and provide services that don’t require innovation or artistry. They’re assembly line. They strip the experience of quality and luxury and fall back on banal consistency of their basic offering: a service, no more, no less.  Design, by nature, is the antithesis of this sort of factory labor, and could never survive if it were to adopt the Ryanair mentality. And for these customers, the luster of shaving a few dollars off their contracts will quickly fade when they’re left with a dismal outcome and a bag of peanuts.

 

Tags | artistry, assembly line, consistency, creativity, crowdsourced, factory, godaddy, industry, innovation, ryanair, vistaprint

23

Jul
2013

News Articles

Permalink

By admin404

StaffList WordPress Plugin

July 23, 2013 - News Articles

If you’re unfamiliar with WordPress, it’s a powerful, extensible blogging architecture that’s quickly spawned a massive contributor base for plugins. ERA404 developed ImageMeta, in 2012, a comprehensive tool for refining and grooming all linked and embedded imagery in your WordPress blog or website, for improved SEO and ultimately more precise/favored search engine ranking. Read more…

Tags | blog, ceo, directory, faculty, listing, plugin, staff, website, wordpress