jeremytubbs/deepzoom

Allow '-' and '_'

Closed this issue · 4 comments

I am wonderring why you disallow '-' and '_' characters on line 261 since these are perfectly normal characters for file name.
I took them out to suit my needs.

Hello,

Are you using the .js or .dzi that is generated by the package?

I plan to not make the output configurable and therefore the naming less strict for the XML .dzi file. The filename is also used as part of a javascript callback in the .js and needs to be validated.

After doing some digging this morning I can allow '_' and '$' in the javascript function name and checking all possible incorrect names is a 11,236 character long regex: http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name

Thanks.

Hi Jeremy,
I think you got me wrong. You are check the file and folder names for there characters.

The file and folder names are set by the image filename if they are not explicitly sent.

Example:

  // folder, file are optional and will default to filename
  $response = $deepzoom->makeTiles('KISS.jpg');

Response:

{
  status: "ok",
  data: {
    JSONP: "KISS/KISS.js",
    DZI: "KISS/KISS.dzi",
    _files: "KISS/KISS_files"
  },
  message: "Everything is okay!"
}

Therefore, I am checking the filename for characters that would invalidate the JSONP. I am working on a fix... You are correct that I don't need the same restrictions for the folder name.

Thanks again.

Filename and Folder Name are now evaluated separately: 8e45923