"Check media type" configuration for Batch Wizard

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

"Check media type" configuration for Batch Wizard

Post by moganero »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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');
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
moganero
Rank II - Novice
Posts: 40
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK

Re: "Check media type" configuration for Batch Wizard

Post by moganero »

Thanks, I'll look into that.
User avatar
moganero
Rank II - Novice
Posts: 40
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK

Re: "Check media type" configuration for Batch Wizard

Post by moganero »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
mackro
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area

Re: "Check media type" configuration for Batch Wizard

Post by mackro »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
mackro
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area

Re: "Check media type" configuration for Batch Wizard

Post by mackro »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

Thanks. I'll look into adding this option and get back to you.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
moganero
Rank II - Novice
Posts: 40
Joined: Tue Feb 01, 2005 5:47 am
Location: Newcastle under Lyme, UK

Re: "Check media type" configuration for Batch Wizard

Post by moganero »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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!
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
mackro
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area

Re: "Check media type" configuration for Batch Wizard

Post by mackro »

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
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
mackro
Rank 0 - Newcomer
Posts: 5
Joined: Fri May 01, 2009 8:04 pm
Location: SF Bay Area

Re: "Check media type" configuration for Batch Wizard

Post by mackro »

emailing now.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: "Check media type" configuration for Batch Wizard

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial