Issue 61: Binary content instead image, if URL parameters.
Status:  Fixed
Owner: ----
Closed:  Oct 2008
Reported by jazz....@gmail.com, Aug 11, 2008
What steps will reproduce the problem?
1. HTML Code: <a href="./image.jpg?nocache=randomcode" 
class="nyroModal">Open</a>


What is the expected output? 

Image in modal window

What do you see instead?

File binary content

What version of the product are you using? On what operating system?

Last version, OS independent.

Please provide any additional information below.

No comments needed.


issue.gif
34.4 KB   View   Download
Aug 12, 2008
Project Member #1 william....@gmail.com
good catch. here is a work around until that can be further looked at. 
this is just one way to work around it. 
i overloaded the processhandler which looks for that and will override and set the 
type to image. now this will only work if your urls have extensions. if you are 
using a servlet or some form of redirection like 'domain.com/image/123' is an iamge 
then this will have to be altered or hard coded to look for some form of url like 
any thing 'domain.com/images/*' should have type set to image. 



<script>
$(function() {
	$.fn.nyroModal.settings.processHandler = function(settings) {
		var from = settings.from;
		if (!settings.type && from && from.href) {
			alert(
				'type should be image: '+settings.type + '\n'
				+ "need to determine if image manually");
			var arr = from.href.split('?');
			//if carrying extra stuff
			if(arr.length>1){
				var newArr=arr[0].split('.');
				var newType=settings.type;
				alert('extension is: ' + newArr[newArr.length-1]);
				switch(newArr[newArr.length-1].toUpperCase()){
					case 'IMG':
					case 'JPG':
					case 'JPEG':
					case 'PNG':
					case 'GIF':
						newType='image';
						break;
					default:
						newType=settings.type;
				}
				alert("new type is " + newType);
				$.nyroModalSettings({
					type: newType//,
					//height: 355, //any other settings could be 
overloaded here
					//width: 425
				});
			}
		}
	};
	
});

binary_image_cnt.zip
84.4 KB   Download
Aug 12, 2008
Project Member #2 william....@gmail.com
(No comment was entered for this change.)
Status: Accepted
Oct 22, 2008
Project Member #3 nyro...@gmail.com
In the release 1.3.0, the extImg setting is replaced by regexImg.
With that, i'm pretty sure you'll be able to do whay you need (and probably more!)
Status: Fixed