"Check media type" configuration for Batch Wizard

For technical support for all editions of CSS HTML Validator. Includes bug reports.
User avatar
moganero
Rank II - Novice
Rank II - Novice
Posts: 32
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK
Contact:

"Check media type" configuration for Batch Wizard

Post by moganero » Fri Apr 04, 2014 6:48 am

Batch wizard is giving me a lot of the following when it does a link check:
54 228:29 http://newcastlecameraclub.org/picture.php?src=296 Check media type img src - Expected an image media type but got "text/html"; alt text is "Buzzard Feeding", missing height and width
My pages are using a php script to write the image into the page to prevent access to the files themselves. Is it possible to configure Batch wizard to ignore this either for a specific filename, e.g. picture.php?

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Apr 04, 2014 8:30 am

Hello,

If your script is outputting an image, then shouldn't it set the proper media type? Like image/jpeg?

Something like (before any other output):

Code: Select all

header('Content-Type: image/jpeg');
Image
Albert Wiersch

User avatar
moganero
Rank II - Novice
Rank II - Novice
Posts: 32
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by moganero » Fri Apr 04, 2014 9:10 am

Thanks, I'll look into that.

User avatar
moganero
Rank II - Novice
Rank II - Novice
Posts: 32
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by moganero » Fri Apr 04, 2014 11:26 am

I've added
header('Content-type: image/jpeg');
immediately before
ImageJPEG($im); in the script that creates the image, but that has made no difference.

Off to Stackoverflow now to see if there are any suggestions there!

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Apr 04, 2014 11:48 am

I checked your link and it still says the content-type is text/html.

It could be that you need to use header() sooner.

The PHP manual says:
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
Good luck! Please let us know how it goes.
Image
Albert Wiersch

mackro
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by mackro » Thu Feb 05, 2015 9:39 pm

I'm having the same issue, getting thousands of these errors being thrown. Is there a way to exclude this from the report, at present it's not something my client will fix and it's making the report kind of useless because the other good data is getting buried.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Feb 06, 2015 10:04 am

Hello,

The easiest way may be exclude the links from being checked in the Exclusions tab of the Batch Wizard. Add the links to exclude in the 'Don't check these links' option. However, there could be a problem if all the links can't easily be specified here (like if there are many) and it will disable all link checking for these links - not just the media type checking.

Would an option to disable media type checking be useful here? Perhaps I could add a new tab in the Batch Wizard called Advanced Options and include an option to disable media type checking for links... or some other way to disable this feature.

Of course I have to note here that it's always better to fix the problems than ignore them. :D
Image
Albert Wiersch

mackro
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by mackro » Fri Feb 06, 2015 10:42 am

That would be amazing if you could add an advanced option to disable this. I agree it is better to fix the problem, but they don't fix the problems in the order I specify, they do them in the priority of what is affecting their users. This particular error has no effect on the user but a huge effect on the report.

There are thousands of them so not easy to create an exclusions list.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Feb 06, 2015 10:55 am

Thanks. I'll look into adding this option and get back to you.
Image
Albert Wiersch

User avatar
moganero
Rank II - Novice
Rank II - Novice
Posts: 32
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by moganero » Fri Feb 06, 2015 11:04 am

I'd find it useful too, especially as I hadn't had a chance to prevent the problem by altering my code. As mackro says, clients often have other priorities.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Feb 06, 2015 4:28 pm

mackro wrote:That would be amazing if you could add an advanced option to disable this. I agree it is better to fix the problem, but they don't fix the problems in the order I specify, they do them in the priority of what is affecting their users. This particular error has no effect on the user but a huge effect on the report.

There are thousands of them so not easy to create an exclusions list.
Hello,

Please try redownloading CSE HTML Validator Enterprise from here:
https://www.htmlvalidator.com/download/registered.php

It says v15.0100 is available but you should get v15.0112 if you download it.

There is a new "Advanced" tab in the Batch Wizard with an option that you can check to disable link media type checking. Please check that option, rerun the Batch Wizard job, and see if resolved the issue. Please let me know. Thanks!
Image
Albert Wiersch

mackro
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by mackro » Fri Feb 06, 2015 6:47 pm

Hi Albert,
I was able to dl the new version and check the checkbox. Didn't have any effect on the scan though, just as many of the check media type errors coming up...

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Fri Feb 06, 2015 7:10 pm

Sorry it didn't work. Can you send me a sample from the Batch Wizard report so I can see exactly what errors you are seeing? It might be easiest to send it via attachment to support at htmlvalidator.com.
Image
Albert Wiersch

mackro
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by mackro » Fri Feb 06, 2015 7:13 pm

emailing now.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch » Tue Feb 10, 2015 11:39 am

A new option in a new Advanced tab in the Batch Wizard is now available to disable link media type checking. Registered users who don't want to wait can get the latest update by downloading the pro or enterprise edition from the registered user download page on the website, or just wait until we go public with the new version update so it can be automatically downloaded and installed by the new updating system in v15.
Image
Albert Wiersch

Post Reply