WordPress There has been an error cropping your image

GD Graphics Library

I was updating my theme with the pretty amazing Twenty Seventeen from WordPress. Attempting to add a site icon it was just… failing. The blue select button in the Media Library would just go grey. When I tried a picture larger than 512×512 pixels I got a step further with the cropping dialogue, but then I’d get…

image.png
There was an error cropping your image.

It turns out WordPress needs the php-gd library for image manipulation.

First work out what php version you are running with

php -v

On Ubuntu/Debian hosts with php 5.x run

sudo apt-get install php5-gd

On RedHat/CentOS hosts with php 5.x run

sudo yum install php-gd

You may need to install specific packages like php56-gd for php 5.6. For php 7.x you will need to install php7.0-gd

Finally restart your web server

/etc/init.d/httpd restart

As an aside: I’m regretting my commitment to add an image to every post. What image makes sense with this post? The official logo for GD is 300×230 pixels.

Apple Touch Icon Sizes Updated for iOS 10

App Apple Logo

http://stackoverflow.com/a/19933647/5118345

Stack Overflow user felipep posted an answer to the question “What size should apple-touch-icon.png be for iPad and iPhone 4?”

His brilliant work is that he updates with all the suggested icon sizes for iOS10, including iPad Pro and every new iPhone and iPad as it is released.

I’m guessing he’ll keep updating it in future.

I started looking for the sizes of app icons when I noticed a lot of HTML 404 errors on a client website. There’s nothing wrong with a client machine asking for a missing file an the web server giving a 404 error. That’s how the internet is supposed to work. But filling an error log with those errors makes real problems harder to find.

As a fix I generated a bunch of icon files of the correct size and dropped them in the root directory of the website. I could have updated the header, or done some symlink magic, but it was quicker and easier to just put the files in place.

The files are currently

  • apple-touch-icon.png
  • apple-touch-icon-precomposed.png
  • apple-touch-icon-57×57.png
  • apple-touch-icon-72×72.png
  • apple-touch-icon-76×76.png
  • apple-touch-icon-114×114.png
  • apple-touch-icon-120×120.png
  • apple-touch-icon-120×120-precomposed.png
  • apple-touch-icon-144×144.png
  • apple-touch-icon-152×152.png
  • apple-touch-icon-180×180.png

The two preocomposed png’s are probably not required but I want to limit my 404’s and they are being requested by someone out there. It’s probably a scam bot, but I don’t want to take the time to work it out right now.

 

Mary Karr’s Poetry

Mary Karr photo by Deborah Feingold/HarperCollins
New Yorker Poetry
New Yorker Poetry

I’m really enjoying the poetry of Mary Karra contributor to the New Yorker. From her short bio:

Mary Karr teaches at Syracuse University and lives in Manhattan. Her New York Times best-seller, The Art of Memoir, will appear in paperback this fall.

I first readThe Crotchgrabberher article “On a shockingly casual case of sexual assault”. It is shocking and a bit disturbing, bit is miscleverand full of insight. Read it.

Looking at her other contributions I discovered a wealth of poetry published by the New Yorker.

Serendipitously over the last month I wanted to findcontemporary, literary poetry.

Illiterate Progenitor grabbed me instantly. I want to savour her work slowly so I made this note to returnto her writing.

I spent a bit of time looking for a photo of Mary to use with this piece. Unfortunately I couldn’t find a Creative Commons or otherwise “free” photo to use. Authors (or their Publicists Publishers) should provide marketing collateral like author photos for exactly this use.

Update: I found HarperCollins OpenBook API which gave me the photo credit.

Technically I’m lifting the photo from Mary Karr’s twitter profile, as the original photo via the API is too small. Also the photo is cropped so it’s a derivative work of Deborah Feingold’s original portrait. While my use of the image is covered by “fair use” provisions, but it would be nice to have the licensing simplified.

Mary Karr photo by Deborah Feingold/HarperCollins
Mary Karr photo by Deborah Feingold/HarperCollins

Encrypt iPhone backup

I’ve updated my Apple iPhone to a 6S and adjusted thecustom iPhone backup locationon my external HDD. This time I’veenabled theEncrypt iPhone backup featurein iTunes.

Apple does not backup important data to transfer to a new phone if you don’t encrypt your backups. Things like:

  • Account passwords
  • WiFi passwords
  • Health app data
  • HomeKitdata

iCloud backs up this data fine, but with only 5GB of iCloud storage, I wanted to backup then restore my 64GB device locally.

The encryption is strong by 2016 standards. You cannot restore a backup without the password. Aside: Obviously the FBI (and NSA) can now hack your iPhone but that’s not the use case here.

If your external HDD is ever lost or stolen, you’ll be glad that your iPhone backup on it is encrypted. Just do it.

Oh! And pick a decent password to encrypt it. Not something your already used on FaceBook, LinkedIn and every other website on the planet. You are using unique passwords and a password locker by now, right? This is 2016 after all.

Server woes

Broken Time 1

Last updated on February 24th, 2016 at 06:30 pm

Broken Time 1
Broken Time 1/e_anka

Sorry to those of you whose emails I’m not receiving.

Unless I’m receiving them and you’re in the smaller group of people who can’t receive my emails.

Unless you’re in a non-intersecting group of people who are connecting to an older server (in which case you can’t see this post).

Unless you’re in a possibly non-intersecting group who couldn’t get to this website because of various server configuration problems.

Basically I’m rebuilding my hosting and that has led to wide-spread disruption. I’ll post an update when I think it’s mostly fixed. I think I’m 80% of the way there. UPDATE: I think it’s fixed.

It’s really frustrating and part of me wishes I went with a well supported WordPress hosted provider. But I do run some non-WP projects on the side so I like to have a server or two around for testing.

Fix Google Analytics Spam

Last updated on February 17th, 2016 at 04:04 am

Bottom line up front: Prevent spam in your Google Analytics with only 2 filters

Google Analytics is the most widely used web analytics service today so it is a target-rich environment for spammers to get eyeballs. They hope that web masters will see their url and check out where the traffic is coming from. The reality is there is no new traffic, it’s all bots manipulating the system.

Google Analytics spam is only bad for the site owner. Users never see the consequences, but the owner’s stats are full of junk, devaluing the data.

After long neglect I’m busy behind-the-scenes with this and other websites. My painful reality is bad guys hitching a ride on my corner of the web. Take care of your neighbourhood unless you want to it to go bad.

Change iPhone Backup Location

Last updated on May 3rd, 2016 at 09:38 am

I have a 64GB iPhone 5S but my MacBook Air only has a 128GB SSD which is not enough to regularly hold a backup of my phone. iCloud offers 5GB free online space so I have to pick and chose what gets synchronised via iCloud.

I decided to move my iTunes iPhone backup location to a 2GB external drive called Seagate1. This is a really easy process for Mac and Windows users.

There is no way to change that within iTunes. I am sure there must be tools you can get online to configure it but I used the Terminal to create a symbolic link to make iTunes to use the external drive.

By default iTunes stores iPhone backups in ~/Library/Applications Support/MobileSync/Backup on Macs and \AppData\Roaming\Apple Computer\MobileSync\Backup on Windows. If you already have a backup you wish to keep, move the Backup folder to the new backup location on your external drive. Otherwise rename the existing Backup folder to BackupOld.

The symlink links the folder from ~/Library/Application Support/MobileSync/Backup to a backup directory on my external drive – in my case /Volumes/Seagate1/iOSBackups/Backup.

Mac OS X
Open Terminal either by searching for Terminal in spotlight or use Finder to navigate tothe Utilities folder inside your Applications folder.

Terminal will normally open in your home folder with a $ prompt.

Type the following command create the symlink, change Seagate1 to your external drive name.

ln -s /Volumes/Seagate1/iOSBackups/Backup ~/Library/Application\ Support/MobileSync/Backup

That’s it! Connect your iPhone and back it up.

Windows

Open the Command Prompt window by clicking the Start button Picture of the Start button, clicking All Programs, clicking Accessories, and then clicking Command Prompt.

Type the following command to create the symlink ,change SEAGATE1 to your external drive letter.

mklink /J "%APPDATA%\Apple Computer\MobileSync\Backup" "[Your External HDD]:\iOSBackups\Backup"

That’s it! Connect your iPhone and back it up.