Entries Tagged as 'Coldfusion'

Vaughan-Bassett on ABC News made in America

One of our clients was on ABC news Made in America tonight.  A Dallas family replaced all their foreign made items with American made items which from the looks of the clips was harder than they thought.

If you go to the listing of the items they bought for the house the bedroom furniture comes from Vaughan-Bassett in Galax, Virginia.

We built their site on Coldfusion, MYSQL, and Fusebox.

Vaughan-Bassett Furniture

 

 

Yahoo SLURP! why are you so greedy?

Yesterday our servers were being hammered from IP address : 67.195.37.172 which appears to be the Yahoo indexer.  Then today I read a tweet from Ben Nadel he was having the same thing happen.  So I thought I would write a quick post in case some others were having the same issue.

On the Yahoo SLURP! page they suggest adding : 

Crawl-delay:10

to your robots.txt file.  Where the number is the seconds of delay before it hits you with another request.

This seemed to stop the problem unless SLURP! just gave up :)

In doing more research there appears to also be a 

Visit-time: 1800-2330

entry you can make but nothing supports it right now. I added it just in case.

 

Amazon Linux AMI and Coldfusion 9

For fun this weekend I was playing with the Amazon Linux on EC2  with Coldfusion 9.  Since Amazon Linux is based on CENTOS I figured it shouldn't be too hard to get it to work so why not...  I'll make the disclaimer now that CENTOS and Amazon Linux are not offically supported, but we have been running Coldfusion 7/8 on CENTOS for a couple years now and it seems to work great once you get the installer and apache connector to work.

I used Basic 64-bit Amazon Linux AMI 1.0 on a Micro T1 instance for my test.  Setting up launching and connecting to the instance is a bit out of reach for this post, but I just used the AWS console and followed the instructions to create my key-pair to SSH in.

Once you have the instance launched and you are connected you use YUM to install apache:

yum install httpd
yum install httpd-devel
yum install libstdc++.so.5

[The httpd-devl and libstdc++.so.5 are required by the Coldfusion installer]

Then Run:

chkconfig httpd on

[This makes Apache start when the Image starts or you reboot it if you are on an EBS instance]

Then you need to get the Linux 64bit Coldfusion 9 off the Adobe website.  it's kinda silly you can't get to it with Curl, wGet, or Lynx.  So I downloaded it and put it on a private S3 Bucket the used curl to download it to my new instance

Then I followed Willem Redelijkheid's post on installing on CENTOS for directions on installing Coldfusion 9 and it worked like a charm.  Only one slight oddity when the Installer progress bar got to the end on the script it sat there for the longest time.  I hit enter and it displayed the Coldfusion install finished method.  Not sure why.

Hope this helps someone else.  If you are running Coldfusion 9 on Amazon Linux ping me in the comments to let me know how it's going.


CFIMAGE CMYK workaround to RGB

I deal with a large amount of CMYK images for work. Some with Color Profiles and some without. So far Coldfusion hasn't been much help. Although it gets closer with each new release. Here is my workaround to convert CMYK images into RGB until Adobe lets us convert images with the CFIMAGE tag.

Starting Image

CMYK Image with Color Profile

Above is the starting image of my faithful coding companion Bailey. I converted it to CMYK and added the U.S. Web Coated (SWOP) v2 color profile in Photoshop. When you try and read this image in Coldfusion 8/9 it throws:

<!--- Try to get image info --->
<cfimage action="info" source="#expandpath(".")#/images/bailey-cmyk-profile-800x600.jpg" structname="cmyk" />

An exception occurred while trying to read the image.
Unsupported Image Type

This is where Imagemagick comes in. We can convert the image to RGB and remove the color profiles so we can continue. I chose to use a BASH script that I call with CFEXECUTE, but it appears to work calling it directly from CFEXECUTE. I had problems in the past with this so I have always done it this way, in case you were wondering.

#!/bin/bash
infile=$1
outfile=$2
/usr/bin/convert $infile -strip -colorspace rgb -quality 100 $outfile
echo "Convert Finished"
exit 0

I pass this script the file I want to convert and where I want to create the new RGB version. The -strip command removes all the Photoshop meta data and the color profile. The -colorspace rgb command converts the image from CMYK to RGB. Finally the -quality 100 sets the JPG quality setting for the new image, I created the original at 100 so I just kept it that way for the new one. (It can be adjusted to your personal preference or requirement from 1 to 100.) The new image will keep the same dimensions and resolution as the original image had to start.

Coldfusion Example

<cftry>
<!--- Try to get image info --->
<cfimage action="info" source="#expandpath(".")#/images/bailey-cmyk-profile-800x600.jpg" structname="cmyk" />
<cfcatch type="any">
<!--- If it fails convert to RGB and Strip Information with ImageMagick --->
<cfexecute name="#expandpath(".")#/img_to_rgb.sh"
arguments="#expandpath(".")#/images/bailey-cmyk-profile-800x600.jpg #expandpath(".")#/images-convert/bailey-rgb-800x600.jpg"
timeout="30" variable="msg" />

</cfcatch>
</cftry>
<!--- Image can now be read --->
<cfimage action="info" source="#expandpath(".")#/images/bailey-rgb-800x600.jpg" structname="cmyk" />

In the Coldfusion example i created here I first try to read the image information. If this fails I call the script to convert the image to RGB and remove the profile information. Then I read the file with CFIMAGE and it works. If that fails then you started out with a bum image to begin with.

If you aren't on OS X or Linux and want to call ImageMagick directly it would work like this :

<cftry>
<!--- Try to get image info --->
<cfimage action="info" source="#expandpath(".")#/images/bailey-cmyk-profile-800x600.jpg" structname="cmyk" />
<cfcatch type="any">
<!--- If it fails convert to RGB and Strip Information with ImageMagick --->
<cfexecute name="/usr/bin/convert"
arguments="#expandpath(".")#/images/bailey-cmyk-profile-800x600.jpg -strip -colorspace rgb -quality 100 #expandpath(".")#/images/bailey-rgb-800x600.jpg"
timeout="30" variable="msg" />

</cfcatch>
</cftry>
<!--- Image can now be read --->
<cfimage action="info" source="#expandpath(".")#/images/bailey-rgb-800x600.jpg" structname="cmyk" />

RGB Image

RGB File after Conversion

So here is the new image of Bailey that is now RGB and all the Profile information removed. The coloring of the image changes slightly when you convert it to RGB from CMYK, but so far I haven't found a way to get it any closer. You can also resize and get the image info with Imagemagick, but I am doing that with CFIMAGE. In hopes that I can one day just comment this out and all the operations will work consistantly. Maybe Adobe will fix that in the next release so this can all be done in CFIMAGE.

Hope this helps out others struggling with the same issue. This works well ( I have converted thousands of images) on Linux and OS X. I haven't tried it on windows, but I would assume it would work by either calling it directly or wrapping it in a BATCH file. If anyone tries it on Windows let me know.

Links



Vote for CFIMAGE to convert CMYK to RGB

Vote for this Bug / enhancement Fix

Feature Request Form

We work with a lot of CMYK formatted images for our clients.  Their original photography comes from the studio as CMYK Jpegs.  They need to be converted to RGB format for use on our Internet sites so we can't use CFIMAGE to create thumbnails or smaller photography.  The only choice we have is to use Imagemagick on the server for all of the image conversion or convert it with Imagemagick and then Resize with CFIMAGE.

If you are in the same boat please vote it up or put in a feature request.