-2

I have a question about my Stack Overflow post: How to program my computer to open a file with a certain application and change the extension

Could someone help me understand why my question was put on hold as too broad? I got a reply saying my description was vague, so I added more details, but if it seems broad/vague that's only because it's a question regarding how to start a program, not regarding a fix or bug. I can't include any code because I haven't written any. I was just looking for ideas on how to approach the problem.

Let me know what information the question leaves you wondering/how I can fix it.

EDIT: I feel like people might be assuming there is more to this task than there is. Here is every single step I have to complete for each file:

  1. Drag the file from Finder into a QT4Image window to open it with QT4Image. The default exposure and gamma on QT4Image are appropriate, so no changes need to be made there. It requires no visual confirmation, it just needs to be opened on QT4Image.
  2. Click File -> Save As.
  3. Copy and paste the file name, and add ".png" to the end of it. The file name is the exact same as it was, except now ends in .png instead of .exr Ex. file32.exr would become file32.png
  4. Put it in the right folder (all the .png files are going in the same folder).

After my clarifying comment, all this information was present in my question. However, people still asked for more context. There is no more context.

The only reason I tagged it as Python was because Stack Overflow required me to tag a language and I know Python -- I guess I should have also specified that the language did not matter to me.

Also, I wasn't asking for anyone to write the code for me. I was asking for ideas regarding how to go about this problem, which could be in the form of a place to start, or links to resources, etc. Is that sort of thing not welcome on here? Please let me know.

6
  • 6
    The information you presented in your comment (the name of the application you need to do the saving/renaming with) is rather important to answering your question i'd assume. If that action can't be done programatically using the application... that makes this a whole nother kind of question.
    – Kevin B
    Aug 21, 2019 at 21:31
  • 5
    I can understand the downvotes on the original question but not on this question on meta. A user comes here and asks in a clear way how to improve. What better can happen? Thanks for asking this question. Aug 21, 2019 at 22:15
  • 1
    @gnat I think that would be related, but not a great duplicate... This is a special case.
    – S.S. Anne
    Aug 21, 2019 at 23:32
  • This can't be a duplicate of asking about too broad if the specific question referenced is not an example of a too broad question (let alone this is about a specific-question and answers have nuance to this particular question). Aug 22, 2019 at 13:01
  • 3
    Regarding your latest edit, evil_scientist; it makes answering significantly more complicated when you add automating a particular interactive program vs asking for the task to be done (without introducing the hoop of trying to automate an interactive program). As I indicate in my answer, your best bet is to edit your question and leave all that out; as unless I miss my guess, you can achieve the same result without even using that particular program. (a question being complicated to answer is not on the OP; since they can't know how complex something is; though it'd be nice). Aug 22, 2019 at 15:09
  • 1
    Stack Overflow does have a tag called language-agnostic if the language doesn't matter to you. However, with that being said, I'm not sure how wise it is to ask for someone to give suggestions using a language you don't know.
    – TylerH
    Aug 23, 2019 at 15:05

2 Answers 2

25

This is the crux of your question:

It's a trivial task but very time consuming, and I am wondering if people have any advice how I would go about coding this instead of doing it manually?

The components of your question are:

I have hundreds of .exr files that I need to convert to .png -- however, each file has to be opened with an application to ensure it has the proper exposure, etc. (which are conveniently the default settings on the app), then saved to a folder.

The basic pieces of automation are there; a large amount of work needs to be accomplished, and the way to approach is clearly defined.

However, that alone doesn't narrow the actual crux of your question. You're asking us how we would go about automating this workflow.

What we don't know is:

  • If we can pass files in to the second application on the command line, or if they have to be somewhere else
  • If the second application requires visual confirmation or if you can rely on passing flags and an exit code
  • What attempts you've made at solving the problem

Stack Overflow works best for questions like this if you come to the table with a clear direction and some portion of it that you're stuck at. Right now, you're at the desk with a blank piece of paper, and so are we; we're not going to be of much value to you if we're guessing too.

27
  • 6
    Questions should not be closed because the user hasn’t attempted anything. That’s a reason to downvote, not close. Aug 21, 2019 at 21:40
  • 8
    The lack of an attempt isn't the issue. It's lack of direction. An attempt would provide direction, but it isn't the only way to provide direction.
    – Kevin B
    Aug 21, 2019 at 21:41
  • 6
    @GeorgeStocker: It's one of three components I list. It's definitely not one that can be overlooked, but I would also imagine the actual part where someone wants to integrate with an application to provide validation would need to be checked to be sure that this kind of automation is even possible to begin with.
    – Makoto
    Aug 21, 2019 at 21:41
  • 15
    @GeorgeStocker I know I've posted this comment before previously, but I believe it holds here: With all due respect I disagree, I don't necessarily want a code attempt, but I want OP to have put some thought into how they'd solve the problem: "I know that some may disagree here but "gimme teh codez" is not the best way to introduce yourself to a community. A demonstration of effort proves that they're willing to take the time to help themselves first." " Aug 21, 2019 at 21:43
  • 1
    @NickA feel free to downvote. There’s nothing new here; if you close a question due to lack of effort, expect a moderator (if they see it) to reopen it. meta.stackoverflow.com/a/253096/16587 Aug 21, 2019 at 21:48
  • 10
  • 14
    @GeorgeStocker: You're painfully overlooking the "validation" part. And that's the part that I have a hang-up on. How do we know if the application can actually do the validation in an automated way? That's the context I'm missing as a Python expert to even bother attempting a solution! (Just for the reference - I mention it twice in my bullet points above.)
    – Makoto
    Aug 21, 2019 at 22:05
  • 12
    Sounds like you've got it right where you want it then @GeorgeStocker; in that case, since you truly believe that it isn't too broad and you also hold the power to do so, feel encouraged to answer it. I've stated my position on this question, and you've demonstrated yours.
    – Makoto
    Aug 21, 2019 at 22:10
  • 5
    @CertainPerformance: If this is the application being used (oh look, another missed detail about the problem domain!), then AutoHotKey would be out of play.
    – Makoto
    Aug 22, 2019 at 1:48
  • 5
    @GeorgeStocker maybe not, but most of these questions usually fall under the TB close reason, not because of a lack of research, but because "if your question could be answered by an entire book, or has many valid answers (but no way to determine which - if any - are correct), then it is probably too broad for our format". Judging by the file format, correctly adjusting the exposure (as asked in the question) is extremely broad. What's "proper exposure"? How on earth do you calculate that? Is it universal?
    – Zoe is on strike Mod
    Aug 22, 2019 at 15:17
  • 9
    @GeorgeStocker no, you don't. You're also forgetting the conversion part. Loading and parsing a .exr is a book of its own, and converting it to PNG as well requires a parser that manages to convert the formats. There's libraries for that (and probably several, meaning it has "too many valid answers"), automatically calculating the correct exposure (unless it's a static value - also not mentioned in the question) takes a few years and a team of ML experts to identify what exposure is correct. And, agian, what is correct? That means there's no way to determine which answers are correct.
    – Zoe is on strike Mod
    Aug 22, 2019 at 15:23
  • 6
    It's also unlikely to be useful to anyone else depending on the definition of what exposure is correct. Converting the image itself is one thing, but modifying it requires a whole different approach. You need to know what data to modify, find a way to validate it, then find the right way to identify the correct exposure, followed by converting that to a .png format. Distinct? Sure! So is "how do I code an app that does <something>", but it doesn't mean it's easily answerable.
    – Zoe is on strike Mod
    Aug 22, 2019 at 15:25
  • 9
    @GeorgeStocker You're missing my point. I'm not saying the use of libraries is the problem, but when it requires thousands of lines of code and thousands of images to train on, that isn't easily answerable. OP refers to it as a "trivial task", but that's because it's powered by a brain. Answering the question, unless the exposure has a static value (which, again, isn't mentioned in the question), requires a replacement for a brain to find the right exposure. There's years and years of research poured into ML, but not a single way to compress the answer into a format that doesn't take
    – Zoe is on strike Mod
    Aug 22, 2019 at 15:31
  • 10
    No, but we ask questions to be reasonably scoped. That's part of the "with enough detail to identify an adequate answer". That question wasn't, and considering the question asker comments in their latest edit, wasn't going to be.
    – yivi
    Aug 22, 2019 at 15:32
  • 12
    Very funny, @GeorgeStocker. I believed that the context of me asking you to answer the question was referring to the OP's question on the main site. Since you still believe it to not be too broad, are you gonna try and tackle that now? Especially in light of what context the OP has added to this question?
    – Makoto
    Aug 22, 2019 at 15:38
-28

Could someone help me understand why my question was put on hold as too broad? I got a reply saying my description was vague, so I added more details, but if it seems broad/vague that's only because it's a question regarding how to start a program, not regarding a fix or bug.

It wasn't too broad. A majority of the three close voters picked 'too broad', and with the three vote experiment, that's all it took.

If we look at the close reason text for 'too broad':

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. (emphasis added)

Are there multiple distinct questions being asked? That is; could you do the middle part of what you want to do programmatically without having to do step 1 (opening the file) or step 3 (changing its extension)?

Possibly #3, but not #1. Opening and closing the file is part and parcel to changing any attributes of that file. In fact, if a person chopped up their questions like that, they're just as likely to annoy others as they are to make others happy.

So did you edit the question to limit it to a specific problem with enough detail?

Yes

This also exposes a problem in our close reason: if a question didn't have enough detail, that should make it 'unclear what you're asking', not too broad; but English is imperfect.

As written, If I squint and tilt my head in the right way I can see a little bit of vagueness, but I had no problems reading the question and understanding what you were asking for, and so that makes "unclear what you're asking" out for me as well.

If I had to boil down your question; you're asking:

I have hundreds of files that I want to change their exposure and extension from .exr to .png. How do I do this in python?

You actually make things worse for yourself the more you specify here. There are hopefully good libraries that do this in python; and you're looking to get it done. You shouldn't care how it's done, just that it's done. If you start to specify a program, you fall into two traps:

  1. The specialization trap. If I ask a programmer to build a website; I don't care what framework they use. If I ask a PHP developer to build a website in .NET Core, all of a sudden they're going to hem and haw and wonder if it can even be done.

  2. The utility trap. Unless that program is used by lots of people who frequent Stack Overflow and consider it a programmer's tool, it's easier to peg the problem as "not related to programming" and ask you to take your problem elsewhere; in the same way that yes, Zoho lets you write scripts, but they have this weird esoteric homegrown language that still gives me nightmares.

In your case; keeping it light on how you want it done helps you get an answer more easily and it helps others to not get caught up in either of those two traps. So unless you're going to get struck by lightning if you don't use a particular program to solve your problem, leave out that detail.

Here's how your question looks now:

I have hundreds of .exr files that I need to convert to .png -- however, each file has to be opened with an application to ensure it has the proper exposure, etc. (which are conveniently the default settings on the app), then saved to a folder. It's a trivial task but very time consuming, and I am wondering if people have any advice how I would go about coding this instead of doing it manually?

The particular application is QT4Image, and each .exr file needs to be opened with that so it has the right exposure, and then saved as "[same file name].png". Instead of opening each individual .exr file with QT4Image, and then clicking "Save As" and pasting the file name.png, I'd like to code this. Any thoughts?

And here's how I'd edit it:

I have hundreds of files that I want to change their exposure and extension from .exr to .png. I'll ask how to programmatically determine the correct exposure in a separate question; for our purposes assume it's an input to the script.

How do I do this in python?

13
  • 22
    I think your edit made it worse. Now we lose context into what program is being used, which would've motivated command-line solutions for those who are well-versed in it, and we are still faced with an overly broad "how do I do X in Y"-style question. I get that you might want to save this question, but for the life of me I cannot figure out why.
    – Makoto
    Aug 22, 2019 at 15:40
  • @Makoto so ask that question instead of attacking? Aug 22, 2019 at 15:41
  • 22
    If you feel me to be attacking you, we can take this to chat later. I'm definitely not attacking you; I'm explaining to you why the OP's original question on the main site was too broad, and why your edit made that worse than what you had intended.
    – Makoto
    Aug 22, 2019 at 15:41
  • 7
    I'm having trouble even seeing how this is a programming problem to begin with; all we have is, "I have this task that needs to be automated", while assuming the solution has to involve code. I don't think adding, "with code" to a problem automatically means it's a programming problem.
    – fbueckert
    Aug 22, 2019 at 16:03
  • @fbueckert I address that here: meta.stackoverflow.com/questions/388734/… Aug 22, 2019 at 16:04
  • 12
    So...because the asker doesn't know any better, we have to help them? I'm going to strongly disagree that a lack of knowledge automatically entitles assistance from our end. That flies in the face of why we close questions in the first place.
    – fbueckert
    Aug 22, 2019 at 16:06
  • 1
    @fbueckert we got rid of the 'minimal understanding' close reason for precisely this reason. Aug 22, 2019 at 16:07
  • 12
    You're arguing a strawman, @George. I don't care if they don't understand; I care about it actually being a programming problem. Asking it here doesn't make it one.
    – fbueckert
    Aug 22, 2019 at 16:08
  • @fbueckert what is programming if not automation of otherwise manual tasks? Did you know that there are large swaths of organizations that still, to this day, refer to their programming departments as "automation"? Aug 22, 2019 at 16:08
  • 6
    Ah, I see where the disconnect is. You see it as de facto code required; I see it as an XY problem, where the assumed solution requires code. Yes, it takes expertise to recognize that it doesn't, but not having that knowledge doesn't make it a problem within a programming scope.
    – fbueckert
    Aug 22, 2019 at 16:11
  • @fbueckert I don't see it as 'code required'; I see that the OP asked it on this site, asking if there was a way in python to do what they want to do. I'm not sure how much more programming you get. "We only allow programming questions by people who know how to program" is a bit gate-keeperish. Aug 22, 2019 at 16:12
  • 8
    See, that's where we disagree. I'm pointing out that asking about a task, and appending, "in code" to the problem makes it a programming problem. That's why I think it's an XY problem. Is it gatekeeping to require askers to present a problem that meets our scope? I disagree with that statement.
    – fbueckert
    Aug 22, 2019 at 16:14
  • 11
    And there is a barrier to entry; you need a modicum of knowledge in the problem space to participate. Is that really gatekeeping?
    – fbueckert
    Aug 22, 2019 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .