News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Another "Your attachment has failed security checks" issue

Started by pasmith, February 28, 2011, 02:40:42 PM

Previous topic - Next topic

pasmith

I'm having trouble with a user attaching images to his posts. This user actually sent me the image and I can confirm it won't upload.

I get the "Your attachment has failed security checks" message. I've confirmed the issue isn't related to file size or file naming. I've opened it in Photoshop and re-saved it as a jpg and it still won't upload. However if I "Save for web" then it uploads fine.

I'm not photoshop-savvy enough to know what exactly happens when you Save for Web. I've confirmed that the original doesn't have layers and its RGB/8 bits channel. If I look at File Info under Raw Data I see (among other things)
<rdf:Description rdf:about=""
            xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
         <tiff:ImageWidth>1024</tiff:ImageWidth>
         <tiff:ImageLength>768</tiff:ImageLength>
         <tiff:BitsPerSample>
            <rdf:Seq>
               <rdf:li>8</rdf:li>
               <rdf:li>8</rdf:li>
               <rdf:li>8</rdf:li>
            </rdf:Seq>
         </tiff:BitsPerSample>
         <tiff:PhotometricInterpretation>2</tiff:PhotometricInterpretation>
         <tiff:Orientation>1</tiff:Orientation>
         <tiff:SamplesPerPixel>3</tiff:SamplesPerPixel>
         <tiff:XResolution>72/1</tiff:XResolution>
         <tiff:YResolution>72/1</tiff:YResolution>
         <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
      </rdf:Description>


So I thought maybe it was a tiff with a jpg extension. I enabled uploading of tiff files, renamed the image to .tiff and tried again, but still no joy.

Any ideas of what I can check next?

PS I was able to attach the image here, so clearly there's a configuration problem somewhere...

EDIT: I should add that we don't have re-encoding turned on, so maybe the image got re-encoded here...

EDIT 2: Yes, it got re-encoded here, in fact I could Save the image from here and it would upload at the problem forum, so I'm nuking the attachment from here so as not to waste space

Bigguy


Arantor

Well, the problem is that the XML in the file trips the scanning and it gets re-encoded as a safety precaution if you turn that on (otherwise it just refuses the file outright), since re-encoding was turned off, it just refused it outright.

pasmith

Does anyone who better understands Photoshop know what the user may have done to get the image in this state (I asked, he is using Photoshop)? Just so I can put it in a FAQ or something?

rugrat

Quote from: pasmith on March 04, 2011, 02:32:03 PM
Does anyone who better understands Photoshop know what the user may have done to get the image in this state (I asked, he is using Photoshop)? Just so I can put it in a FAQ or something?

I have a user that has the same problem. I just turned on re-encoding and it solved the problem. I'd ask your user how they are saving the image and see if you can recreate that. What color space are they using? What is the ppi of the image? What size in pixels is it? Are they saving as a standard or progressive jpg? What quality are they saving at? Also look at the metadata and see if there is anything strange in there. Could be any of that or maybe not. Save for Web is probably their best bet.

Lou69

Still could be the file is too large. Check you attachment options. I often get people that are trying to upload 6 meg image files.

I have had the same issue occur to me and certain members of several forums of mine and it seems to be a hit or miss situation with members. However, in every case it has been related to a member that used the vendor camera software and did a download from the camera to the user drive and then attempted to attach the same image to a post.  All of those images where huge and possible had proprietary data encoded in them.

Saving/re-saving in PS as a .jpg/whatever did not help as the file size remained unchanged. Resizing and the re-saving the image did sometimes work, but not always.

Saving in PS with the 'for the web' option will reduce the file size and maybe does what ever magic is necessary as far as stripping out proprietary stuff, so that the file can be successfully uploaded.

The only solution I have found thus far is to use the 'save for web' option.

Lou69

Been playing with this a bit today.

The .jpg files that are failing have all been saved in a Mac version of Photoshop. Saving and resizing the files, as well as removing the ICC data does not permit the file to be uploaded. Only by removing the EXIF data can the file be uploaded and saved as an attachment.

When using a Windows Photoshop 7, and using the 'save for web' option, it appears that all EXIF data is removed, thus enabling the .jpg file to be uploaded.

I tested this on a WAMP server with SMF 2.4, RC 4 installed,  no mods installed.

Hope this helps someone.

butchs

If you have Macintosh Photoshop I believe that you can have an issue with the format of the file   I do not remember all the details but a few years ago I had a similar issue with files being loaded on internet explorer.  I believe one was an obsolete JIFF or JPG 2k format saved as a jpg and the other issue was a file with a png extensions that was not a png.  When I loaded and re-saved the image file with the proper extension in Mac Preview the problem went away.  Preview saves the files in a format that windows applications like.
???
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Advertisement: