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

Change file path for saving image to be optional #208

Closed
dmyers opened this issue Mar 24, 2013 · 4 comments
Closed

Change file path for saving image to be optional #208

dmyers opened this issue Mar 24, 2013 · 4 comments

Comments

@dmyers
Copy link

dmyers commented Mar 24, 2013

It looks like the save() function for images requires a file path.
https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Gd/Image.php#L190

What do you think of making it optional and if one isn't given defaulting to the currently loaded image like resize() would.

@romainneutron
Copy link
Collaborator

This is not possible for the moment as the ImageInterface does not know anything about the source (may be a binary string, may be a file...).

It could be solved by passing some data about the source itself to the ImageInterface. This introduces a concept of metadata in ImageInterface. Metadata could be an array of metadata parameters that could be used for such operation.

What you (@dmyers and others) think about this ?

@dmyers
Copy link
Author

dmyers commented Jul 8, 2013

Oh I see what you're saying it just knows the resource, but not the path that is currently loaded. Wonder if some refactoring could bring this feature in? It does seem strange that resize() doesn't require a path doesn't it?

@romainneutron
Copy link
Collaborator

This is doable but introduce a new concept. Let's think about this for version 0.6

romainneutron added a commit to romainneutron/Imagine that referenced this issue Jul 19, 2013
romainneutron added a commit to romainneutron/Imagine that referenced this issue Jul 19, 2013
romainneutron added a commit to romainneutron/Imagine that referenced this issue Aug 15, 2013
romainneutron added a commit that referenced this issue Aug 15, 2013
Fix #208 and #232 : ImageInterface::save $path argument is now optional, format option is now optional
@dmyers
Copy link
Author

dmyers commented Aug 15, 2013

Thanks @romainneutron, you rock! 👍

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

No branches or pull requests

2 participants