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 to rename images before copying into collection #5192

Closed
Anthropos888 opened this issue Jan 4, 2019 · 17 comments
Closed

Allow to rename images before copying into collection #5192

Anthropos888 opened this issue Jan 4, 2019 · 17 comments

Comments

@Anthropos888
Copy link
Contributor

Reproduction Steps
  1. Open card editor
  2. Click on edit symbol next to an image field
  3. Click on "gallery" and choose an image
Expected Result

Long press on the image shows several options as in the standard file browser. Especially "rename" should be possible.

Actual Result

No long press, no functions at all. I can't rename the picture. I need to leave AnkiDroid and open the standard file browser in order to rename the image.

Also: it can cause synching problems if the filename of the image (let's say "download.jpg") already exists. So the rename function should be essential here. Also it is highly unlikely that users want to keep the default name of downloaded images (these names are often ridiculous long) so renaming them before copying to the collection makes sense.

Debug info

AnkiDroid Version = 2.9alpha55

Android Version = 8.1.0

ACRA UUID = f2d13677-d957-460e-9f8e-33ca6f832c17

Research

Enter an [ x ] character to confirm the points below:

[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ x] I have checked the manual and the FAQ and could not find a solution to my issue

[ x ] I have searched for similar existing issues here and on the user forum

@mikehardy
Copy link
Member

How does Anki Desktop handle this?

@mikehardy mikehardy added Needs Author Reply Waiting for a reply from the original author Needs Triage labels Jan 4, 2019
@Anthropos888
Copy link
Contributor Author

Anthropos888 commented Jan 4, 2019

Well, in Anki desktop you can just drag and drop any picture (local or from a website) into the image field. That would be the ultimate solution, but I think it's highly unlikely to realize this on Android.

About renaming on Anki desktop: that's not an issue since you can rename the picture at any place and then just drag and drop it into the image field. For example, you could have opened chrome, anki and your desktop next to each other, then drag an image from chrome to the desktop, press F2 to rename it and then drag it into Anki's image field. Just a matter of seconds.
On Android things are way more time consuming so a rename function would save a lot of time since you don't need to switch forth and back from Anki to the file browser etc.

@mikehardy
Copy link
Member

I get that renaming is a big pain on Android (where task switching is terrible) vs the desktop, what I was hoping for was how Anki Desktop handles it when you attempt to import a new media file that has the same name as the old media file. Sorry if I wasn't clear!

As for drag-n-drop, the most useful analog for Android will be if the clipboard issue is resolved with support for images #5023 (which supercedes #3426)

@Anthropos888
Copy link
Contributor Author

Anthropos888 commented Jan 5, 2019

Anki desktop has an "add image/audio/video" button (or press F3) in the card browser/card editor. That button opens a small file browser where you can navigate to your picture. The context menu there allows "rename", "delete" and "new folder" which are all very useful in my eyes.

Would be great if AnkiDroid could copy that.

Edit: about the import of files with the same name: when you add a file via drag and drop or the "add" button, then Anki desktop will immediately rename it to "download (1).jpg" if "download.jpg" already exists.

@mikehardy
Copy link
Member

Okay, I see what you're saying and I don't disagree, but I have a very specific question about collisions:

how Anki Desktop handles it when you attempt to import a new media file that has the same name as the old media file.

Assume you do no rename. Your collection has "foo.jpg" already (used in card 1). You attempt to import another media file "foo.jpg" on a new card (or while editing card 2). What happens to foo.jpg-original, foo.jpg-new, card 1 and card 2?

@Anthropos888
Copy link
Contributor Author

Did you read my edit? The old picture remains untouched. The new picture will be renamed to "foo (1).jpg" automatically before copying it to the collection.

@mikehardy
Copy link
Member

Just read the edit now, sorry :-). Interesting. I think they must be using the operating system copy, and at a low-level operating system copies on desktop operating systems handle name collisions like that. Hmmm

@mikehardy
Copy link
Member

Would you agree in principle that this is two separate issues? One is a bug where we don't handle name collisions like desktop. The other is an enhancement requests to support all the import media features (rename) etc. I say that because handling collisions should be relatively easy and something we should do quickly, whereas enhancement requests always take longer. If you agree, I'd keep this one for the enhancement request, and a new issue with a laser focus on "handle media import filename collisions like Anki Desktop" would be good

@Anthropos888
Copy link
Contributor Author

Ok, sounds good!

@github-actions
Copy link
Contributor

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Aug 18, 2020
@david-allison david-allison reopened this Aug 25, 2020
@mikehardy mikehardy removed this from the 2.13 release milestone Aug 25, 2020
@mikehardy mikehardy added this to the 2.14 release milestone Aug 25, 2020
@david-allison
Copy link
Member

This needs a fair bit of refactoring work before it goes in. There's a lot of unnecessary state usage in the current class, and I'd rather not add to the complexity

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2021

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions
Copy link
Contributor

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2021

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Jun 3, 2021
@prateek-singh-3212
Copy link
Member

@mikehardy @david-allison-1 is this issue is valid now?

@github-actions github-actions bot removed the Stale label Jun 5, 2021
@mikehardy
Copy link
Member

Maybe, I just reread it and I'm not sure what the exact spec for the feature should be as it is entangled here between collision and rename on import. Without a clean / complete specification it's not a good issue to implement. If you want to check out how desktop does optional rename on import and try to specify the feature first that is the first step, then we can think about it again

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2021

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

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

No branches or pull requests

4 participants