You are not logged in.

#1 2014-06-11 16:57:50

Box0
Member
From: Italy
Registered: 2011-09-21
Posts: 218

[SOLVED] Adjust transition speed in muPDF

Does anybody know if it's possible to adjust the transition speed in muPDF?

The same PDF behave differently when opened with muPDF and, say, okular. In muPDF the transwipe transition is noticeably slower.

Can the speed be customized?

Last edited by Box0 (2014-06-14 00:57:45)

Offline

#2 2014-06-13 11:28:30

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED] Adjust transition speed in muPDF

The beauty of FOSS: You can use mupdf-git and apply a little patch to it. Preferably it should include another switch, so that the user can change the transition time when running the application, but maybe it will be sufficient in your case to use this:

# Contributor: Army 
# Maintainer: Stefan Husmann <stefan-husmannt-online.de> 

_pkgname=mupdf
pkgname=$_pkgname-git
pkgver=1.5
pkgrel=1
pkgdesc="lightweight PDF viewer and toolkit written in portable C"
arch=('i686' 'x86_64')
url="http://mupdf.com"
license=('GPL3')
depends=('libxext' 'jbig2dec' 'desktop-file-utils' 'libjpeg' 'openssl')
makedepends=('git')
provides=("$_pkgname")
conflicts=("$_pkgname")
install=$pkgname.install
source=("$_pkgname::git+git://git.ghostscript.com/mupdf.git" 'mupdf.desktop' 'transition.patch')
md5sums=('SKIP'
         '54abfeb678a7dfca238fa8d423f8d2fc'
         'SKIP')
options=('!makeflags' 'staticlibs')

pkgver() {
  cd "$srcdir/$_pkgname"
  echo $(git describe --tags | sed 's|-|.|g')
}

prepare() {
  cd "$srcdir/$_pkgname"
  git submodule update --init thirdparty/openjpeg
  git submodule update --init thirdparty/mujs
  patch -p2 < ${srcdir}/transition.patch
}

build() {
  CFLAGS+=' -fPIC'
  CXXFLAGS+=' -fPIC'
  cd "$srcdir/$_pkgname"
  make build=release prefix="$pkgdir/usr"
}

package() {
  cd "$srcdir/$_pkgname"
  make build=release prefix="$pkgdir/usr" install
  install -Dm644 $srcdir/mupdf.desktop \
    $pkgdir/usr/share/applications/mupdf.desktop
  find "$pkgdir"/usr/include \
    "$pkgdir"/usr/share \
    "$pkgdir"/usr/lib -type f | xargs chmod -v 0644
}
--- src/mupdf/platform/x11/pdfapp.c	2014-06-13 12:53:59.792298701 +0200
+++ src/mupdf/platform/x11/pdfapp.c	2014-06-13 12:54:40.924001922 +0200
@@ -115,7 +115,7 @@
 	app->scrh = 480;
 	app->resolution = 72;
 	app->ctx = ctx;
-	app->transition.duration = 0.25;
+	app->transition.duration = 0.1;
 	app->transition.type = FZ_TRANSITION_FADE;
 #ifdef _WIN32
 	app->colorspace = fz_device_bgr(ctx);

Second part goes into transition.patch as stated in the provided PKGBUILD. Change transition.duration to your liking. Leaving it at 0.1 like in this example makes the transition pretty fast, although the transition mode is blend with the git package. According to ''src/mupdf/source/fitz/transition.c'' there are other modes as well.

Last edited by emeres (2014-06-13 11:35:13)

Offline

#3 2014-06-14 00:58:22

Box0
Member
From: Italy
Registered: 2011-09-21
Posts: 218

Re: [SOLVED] Adjust transition speed in muPDF

thanks!

Offline

Board footer

Powered by FluxBB