Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow '-' and '_' #3

Closed
klibansky opened this issue Sep 24, 2015 · 4 comments
Closed

Allow '-' and '_' #3

klibansky opened this issue Sep 24, 2015 · 4 comments

Comments

@klibansky
Copy link

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.

@jeremytubbs
Copy link
Owner

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.

@klibansky
Copy link
Author

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

@jeremytubbs
Copy link
Owner

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.

@jeremytubbs
Copy link
Owner

Filename and Folder Name are now evaluated separately: 8e45923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants