Closed Bug 45823 Opened 25 years ago Closed 22 years ago

[D&D] Dragging non-link image to the Finder creates text clipping

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)

PowerPC
All
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: lordpixel, Assigned: sfraser_bugs)

References

Details

(Keywords: platform-parity, topembed, Whiteboard: [nsbeta3-])

Attachments

(1 file, 1 obsolete file)

Great work fixing up Image and Link D&D bugs, guys.

Currently, dragging an image that is inside a link (<a>) works great, but on
Macintosh with the Jul 17/18 nightly dragging an image that is *not* inside a
link creates a text clipping with the name of the image inside it, rather than
downloading the image!

Obviously this doesn't match the spec:
http://www.mozilla.org/docs/refList/user-interface/specs/dragndrop/
Some images cannot be dragged to the desktop at all:

e.g. http://www.w3c.org/

Try to drag the w3c logo to the desktop - its won't drag to the desktop it snaps
back.

Contrast www.palm.com. 

Try to drag the round Palm logo to the desktop. If you can get the drag to start 
at all, you will see the text clipping behaviour I mentioned in the initial 
description.

this is a dupe of another bug, i don't know who has it though.
Looks similar to:
http://bugzilla.mozilla.org/show_bug.cgi?id=44260

But the symptoms are not the same.

44260 says that linked images create a clipping with the alt text in them
(which in my experience is no longer true)
This bug says *unlinked* images create a clipping with the *filename* in them.

Could be the same underlying cause....
->pinkerton
Assignee: trudelle → pinkerton
changing qa contact to eli, since this is D&D. Eli, didn't you already file 
this bug? Please mark it a dupe if you did, or tell me that I'm hallucinating 
and that this one is new.
QA Contact: jrgm → elig
brade did the image work, looks like hers
Assignee: pinkerton → brade
cc puetzk@iastate.edu; Kevin--do you think you could help us look into this bug?  
This bug is probably caused by a relative url being dragged instead of an 
absolute url.
Marking confirmed
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Dragging an Image that is not also a link to the Desktop creates a text clipping! → [D&D]Drag Image that isn't also a link to Desktop creates text clipping!
reassign to Ben since this fix will be in navigatorDD.js file; Ben, I'm going on 
sabbatical so I won't be able to fix this for 6 weeks.  Sorry!

pinkerton--ben may need some help with this one since it's mac-specific
Assignee: brade → ben
Keywords: nsbeta3, pp
nav triage team:
as long as save as works, we can live with this, unhappily.  Pinkerton, if you 
care, reassign to yourself
Whiteboard: [nsbeta3-]
Build: 2000090820, MacOS 9.0

What I got:
* text clipping
* name of clipping = some approximation of ALT text (e.g. `&gt;' in the ALT text
  appeared as `&gt;', and not `>' as it should have done), surrounded by [] and
  followed by ` clipping'
* contents of clipping = the same approximation of ALT text, surrounded by []
* Comments field of clipping = nothing

What I expected:
* picture clipping
* name of clipping = replacement text as calculated by the
  getAltSomethingSomething function (sorry, can't remember its proper name), with
  colons converted to dashes, followed by ` clipping'
* Comments field for clipping = URL of image.

Taking QA, since Eli has gone.
QA Contact: elig → mpt
*** Bug 89082 has been marked as a duplicate of this bug. ***
Note that the reporter of bug 89082 thought you should get the image file after 
the drag, whereas mpt suggested in this bug that you should get an image 
clipping.  (Are those the same thing?  I'm not a Mac person.)
OS: All
It doesn't *really* matter. An image clipping is just a built in kind image 
format in any case. 

But actually, given the image you're dragging is (99%) likely to be a GIF, PNG or 
JPEG I'd say just download the image and give it the filename it has on the 
server. 

There are a couple of reasons for this:

* I'm not as interested in what the alt text is as I am in what the creator of 
the image named it. Most images don't have good alt text, and Matthew once spent 
a long time convincing me that a lot of images shouldn't have alt text at all.

* Picture clipping are encoded in the old Mac image format (old as in versions < 
Mac OS X) PICT. Given the image on the server is PNG/GIF/JPEG in all probability 
converting it to a PICT could either mess up the palette or force the user to go 
through another round of lossy compression to change it back into a JPEG. PICTs 
may also be a larger size than the original. Plus I'd rather have the image in 
the format it was intended. I'm highly unlikely to want to work with a PICT if 
I'm a web designer (and ordinary users probably just want to save the image "as 
is").

* Mac users can open any of those formats, either by using Mozilla, or by using 
Quicktime, its not like it being a clipping confers an advantage...

Now, if we were offering the ability to drag and drop arbitrary regions on a page 
and have the browser save those, maybe a clipping would work. But that's another 
bug: specifically bug 41480.


> It doesn't *really* matter. An image clipping is just a built in kind image 
> format in any case. 

Image clipping is less useful because it can't conveniently be opened in another image 
application; it can only be imported into one via the clipboard. Also, file utilities such as Acme 
CMM Widgets can't be used to audit the image information (size, type, color info, etc), since it's 
not the actual file.

Embedding the alt text or url into the file's info field would be nice. Actually, it would be very 
nice.

> Plus I'd rather have the image in the format it was intended. I'm highly
> unlikely to want to work with a PICT if I'm a web designer (and ordinary users
> probably just want to save the image "as is").

Ding!
*** Bug 94343 has been marked as a duplicate of this bug. ***
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1
Reproduced in build 2001111508, Mac OS 9.1. --> pchen after talking with Ben.
Assignee: ben → pchen
Status: ASSIGNED → NEW
Component: XP Toolkit/Widgets → XP Apps: Drag and Drop
Summary: [D&D]Drag Image that isn't also a link to Desktop creates text clipping! → [D&D] Dragging non-link image to the Finder creates text clipping
->XP Apps default assignee
Assignee: pchen → trudelle
Component: XP Apps: Drag and Drop → XP Apps
QA Contact: mpt → sairuh
Target Milestone: mozilla1.1 → ---
->xpapps d&d
Assignee: trudelle → blaker
Component: XP Apps → XP Apps: Drag and Drop
Keywords: nsbeta3
QA Contact: sairuh → tpreston
Whatever happened to copy image? I thought someone (anthonyd?) was working on
that awhile ago.
Target Milestone: --- → Future
Gosh, this one's been around a long time... Any idea when it's going
to get fixed :(
is this a duplicate of bug 97413?
*** Bug 155872 has been marked as a duplicate of this bug. ***
qa contact -> pmac
QA Contact: tpreston → pmac
QA Contact: pmac → sairuh
Taking
Assignee: blaker → sfraser
This patch allows dragging images to the Finder, for Chimera (it's a patch
against the Chimera branch). The main changes were to add HFS Promise flavors
to the drag, and to handle them by creating a file, then using
nsIWebBrowserPersist to save the image to the file, given its source URL.

This patch requires the patch in attachment 110631 [details] [diff] [review] in bug 45824 to work.
Sweet.. Can't wait to see this implemented.  Can we get the ball rolling to
review this?  I can't wait.  This has been one of the biggest setbacks mozilla
has IMHO.

Now Windows doesn't seem to have dragable images yet either...
No longer future.
Status: NEW → ASSIGNED
Target Milestone: Future → ---
Comment on attachment 110633 [details] [diff] [review]
widget changes  for dragging images to the Finder on Mac

remove the printf's or put it in a DEBUG block.

This line has inconsistent spacing compared to nearly identical lines 3 and 4
above it:
::AddDragItemFlavor ( mDragRef, itemIndex, macOSFlavor, NULL, 0, flags );


For this block, I think we need to initialize dataSize since it isn't
guaranteed to be set if GetTransferData has some type of error.
+      PRUint32 dataSize;
+      item->GetTransferData(kFilePromiseURLMime,
getter_AddRefs(imageURLPrimitive), &dataSize);

You don't need to initialize err in this case (I'd just declare it on the
assignment line):
+  OSErr err = noErr;
+
+  AEDesc dropLocAlias = { typeNull, nil };
+  err = ::GetDropLocation(dragRef, &dropLocAlias);

CreatePromisedFile also assigns err twice in a row (if you care about such
minor waste).

For the following line, I prefer the != noError format you use earlier in the
patch.	However, choose whichever format you prefer.
+    if (!(err = ::FSpGetFInfo(fss, &finderInfo)))

This only addresses Cocoa widget changes; non-cocoa Mac builds will still have
problems, right?
QA Contact: sairuh → pmac
This patch addresses brade's and mike's comments, and, as an extra holiday
bonus, adds 'PICT' data to the drag so that you can drag images directly into
PhotoShop. At last, we have 4.x parity, just 4 years later!
Attachment #110633 - Attachment is obsolete: true
Blocks: 187983
Comment on attachment 110812 [details] [diff] [review]
widget/src/cocoa patch

r=brade

however, this block may need some minor adjustment to account for a 0-sized
pichandle:
+      PicHandle picture = nsnull;
+      image->ConvertToPICT(&picture);
+      if (!picture) return cantGetFlavorErr; 
+
+      PRInt32 pictSize = ::GetHandleSize((Handle)picture);
+      char* pictData = nsMemory::Alloc(pictSize);
+      if (pictData) {
+	 ::BlockMoveData(*picture, pictData, pictSize);    // doesn't move
memory
+	 *outData = pictData;
+	 *outDataSize = pictSize;
+	 retVal = noErr;
+      }
+      else
+	 retVal = cantGetFlavorErr;
Attachment #110812 - Flags: review+
> however, this block may need some minor adjustment to account for a 0-sized
> pichandle:

Brade, sounds simple enough. Is this what you mean?

+      PRInt32 pictSize = ::GetHandleSize((Handle)picture);
+      if (!pictSize) return cantGetFlavorErr; 

It it too late to get this in 1.3?
Ed Sabol--yes, that is what I meant
And yes, I'd guess it's too late to get this into 1.3 but I'm not sure.
We have a really nice patch here. It just needs one little tweak, I think. I
hope we can get this landed for 1.4a now that Simon is supposedly back...
Keywords: topembed
It seems to me this was fixed by Bug 193053.
Yup.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 203682 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: