Age | Commit message (Collapse) | Author |
|
Fixes opening non-PDF files from email programs that use a ContentProvider
to supply attachments.
|
|
On 2.3.x, opening files from the Android email app (not Gmail), was causing
a crash due to a SecurityException. On 4.x, it was failing with an error
message.
I think we should have just been calling
getContentResolver().openInputStream(uri) to get the file data, rather than
reading the row from the content resolver and looking at the _data field.
On 2.3.x querying this row caused a security error. On 4.x, we got back
a _data field containing a path, but this path was internal to the email
app, and not for our consumption.
Previously we were calling openInputStream() only as a fallback; now we try
it first, and fall back to the other method if that fails. I suspect we can
delete the other code, but I can't test on the 3.x version of the Transformer
Prime, so I'm leaving it be for now.
|
|
Use the UTI 'public.cbz-archive' instead of the more generic
'public.zip-archive'. It's likely another app (or the OS) has an
Exported UTI for 'public.zip-archive' which would take precedence over
our Imported UTI and not have a 'cbz' extension.
It's not entirely clear what the correct UTI to use for CBZs is (there
are a few), but public.cbz-archive seems to be most likely candidate.
Remove the 'zip' extension, as we probably don't want to load arbitrary
zip files.
Add mimetypes for all completeness, and separate OXPS from XPS as it has
a different mimetype.
|
|
The GUI layout tool instantiates custom controls classes to display a
preview in the IDE. It relies on the 2-argument constructor being
implemented.
Use a different means to get the window manager that works for non-activity
contexts, and avoid creating gesture recognizers in this situation.
Based on a patch supplied by Masaki Muranaka
|
|
|
|
|
|
|
|
Use intptr_t when casting between a jlong and a pointer to suppress errors
about different size words.
Add a 'u' suffix to unsigned values output by the cmap dump utility.
|
|
|
|
Correct an off-by-one error in the file deletion code.
|
|
Fixes bug #694711. As far as I could see, opening an XPS worked fine, the
first time. However, if the same file was opened a second time, then it
should have been saved with a number, e.g. foo(1).xps. However, the period
was ommitted, so the file wasn't recognised as an XPS.
This presumably wasn't an issue for PDF files, as PDF format is assumed
by default (I am guessing).
|
|
Most were pretty harmless, and were addressed by renaming functions to match the Core
Foundation naming conventions, but there was one actual memory leak, and some potential
uses of uninitialised data.
|
|
Fixes bug #695191 - Mupdf Build49/armv7a & Android 3.1: cycles
through subset of pages & page scrubber
The problem here was that in Honeycomb, various bitmap operations
(including drawing via JNI) do not update the bitmap generation count.
When hardware acceleration is enabled, this means that the underlying GL
layer is not aware that the bitmap has changed, and ends up reusing old
textures.
To workaround this, we erase the bitmap before drawing the page. Erase
appears to be the only operation I could find (after pouring through the
source), which actually increments the generation count. The other option
would have been to disable hardware acceleration, but that was far less ideal.
|
|
env/clazz pointers in globals.
The env/clazz pointers are stashed in the globals structure so that they can
be accessed by callback functions in mupdf.c (such as bufferStreamSeek()).
The intention is that only one thread (i.e. the AsyncTask background thread)
reads/writes these stashed pointers. Because cookies are created/destroyed
in the main thread, we add a new version of get_globals() which doesn't trample
these pointers.
|
|
to file and open from file works
Patch was supplied by gong_su@hotmail.com. Thanks!
|
|
then pressing back button again.
I've also added an onCancel() handler, so that the back button only needs
to be pressed once to return to the file picker view.
Spotted while looking at bug #693719 - Attached PDF file does not display (edit)
|
|
crash when rotating the device.
When cancelling a render async task, we now wait for it to actually finish
before continuing. The benefit of this is that we should be able to guarantee
that its Bitmap becomes eligible for GC before we continue to create any
new bitmaps.
This should hopefully help with the OOM errors seen when rotating
the device and trying to create the new bitmaps.
To prevent the UI thread from being blocked for too long while we're waiting
for the async task to finish, we use a fz_cookie and set the 'abort' flag to
request the render be stopped as soon as possible.
|
|
|
|
Android sometimes calls the 'getSelectedView()' method of an AdapterView.
This can be made to happen more predicatably by enabling the Talkback
accessibility feature.
Remove the UnsupportedOperationException and just return null, as we the
ReaderView does not have the concept of a selected page.
|
|
If an iOS app uses too much memory, the OS asks it to free up some space.
If it doesn't do so in a timely manner, it will get a second warning before
being killed by the OS.
In other platforms, where malloc() return NULL in OOM, the store scavenger
releases memory when mallocs fail. In iOS, mallocs usually never return NULL
because the app is killed before this can happen. Therefore, we need to
initiate a scavenge from the low memory notification instead.
We evict the store to 50% of its current size when a memory warning occurs
when it is in the foreground, and 0% when a memory warning occurs whilst
it is in the background. Having said this, I didn't manage to get a background
warning to occur, presumably because we don't request background execution
Therefore, I think in practice the OS just kills the process. However, this
will be useful if we ever add background execution.
|
|
renders a specific PDF
Some async tasks were still trying to access the globals pointer, which had
been nulled during shutdown, leading to a crash.
Check for NULL and return cleanly in this case.
Possibly we should also be calling AsyncTask.get() to wait for the tasks to
finish, before nulling the global pointer?
|
|
|
|
|
|
Replace the DroidSansFallback TTF files with a TTC that has two fonts:
The original and a copy where the OpenType 'vert' substitution
lookup has been pre-applied by copying the uniXXXX.vert glyph data
to uniXXXX.
|
|
|
|
|
|
|
|
|
|
Add a new function pdfapp_autozoom to fit the page to the window by comparing
the aspect ratios of the page and the window to choose whether to fit
horizontally or vertically.
|
|
Fix broken solution file and add project entries for new files.
|
|
This adds a custom memory management layer between libjpeg and the calling
app - in such a way that the code can be shared between mupdf and
Ghostscript/PDL.
|
|
Convert from UTF-8 to UCS-2 to display unicode text properly.
|
|
These files are maintained by debian. Now that debian updates the mupdf package
more regularly there is no need for us to keep our own debian packaging files.
https://packages.debian.org/unstable/main/mupdf
|
|
SC_MAXIMIZE is only sent when maximizing via the maximize button.
Dragging to the screen edge, double clicking the title bar or
WinKey+Up do not generate an SC_MAXIMIZE message.
Detect when gettincg a WM_SIZE message with SIZE_MAXIMIZE instead.
|
|
Use an explicit list of resolutions for +/- zoom stepping.
|
|
|
|
|
|
|
|
Previously, the overhead for the HTTP requests and responses
was too high, e.g. pdfref17.pdf would result in almost 8000
separate HTTP requests (but with this patch about 30.
|
|
Previously any warning displayed at the top of the page
would never disappear because the display timeout being
set would be overwritten by the later initialization.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Debian doesn't have libopenjp2 as a package (whereas gentoo does) so
I've removed it from the control file. You'll need to use the
thirdparty submodule for openjpeg2 until such a time as it exists.
|
|
Only add newlines between selected lines of text.
|
|
Previously errors from curl_easy_perform() were never checked. This
caused mupdf to enter an eternal loop, repeatedly trying to get data
to parse from the remote host.
|